Skip to content

Commit 8dfd1cd

Browse files
committed
Do not error if block submit fails in mock mining case in Nakamoto
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent cd702e7 commit 8dfd1cd

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

testnet/stacks-node/src/nakamoto_node/relayer.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,20 +1066,23 @@ impl RelayerThread {
10661066

10671067
// sign and broadcast
10681068
let mut op_signer = self.keychain.generate_op_signer();
1069-
let txid = self
1070-
.bitcoin_controller
1071-
.submit_operation(
1072-
last_committed.get_epoch_id().clone(),
1073-
BlockstackOperationType::LeaderBlockCommit(
1074-
last_committed.get_block_commit().clone(),
1075-
),
1076-
&mut op_signer,
1077-
1,
1078-
)
1079-
.map_err(|e| {
1069+
let res = self.bitcoin_controller.submit_operation(
1070+
last_committed.get_epoch_id().clone(),
1071+
BlockstackOperationType::LeaderBlockCommit(last_committed.get_block_commit().clone()),
1072+
&mut op_signer,
1073+
1,
1074+
);
1075+
let txid = match res {
1076+
Ok(txid) => txid,
1077+
Err(e) => {
1078+
if self.config.node.mock_mining {
1079+
debug!("Relayer: Mock-mining enabled; not sending Bitcoin transaction");
1080+
return Ok(());
1081+
}
10801082
warn!("Failed to submit block-commit bitcoin transaction: {e}");
1081-
NakamotoNodeError::BurnchainSubmissionFailed(e)
1082-
})?;
1083+
return Err(NakamotoNodeError::BurnchainSubmissionFailed(e));
1084+
}
1085+
};
10831086

10841087
info!(
10851088
"Relayer: Submitted block-commit";

0 commit comments

Comments
 (0)