Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not error if block submit fails in mock mining case in Nakamoto #5294

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions testnet/stacks-node/src/nakamoto_node/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1066,20 +1066,23 @@ impl RelayerThread {

// sign and broadcast
let mut op_signer = self.keychain.generate_op_signer();
let txid = self
.bitcoin_controller
.submit_operation(
last_committed.get_epoch_id().clone(),
BlockstackOperationType::LeaderBlockCommit(
last_committed.get_block_commit().clone(),
),
&mut op_signer,
1,
)
.map_err(|e| {
let res = self.bitcoin_controller.submit_operation(
last_committed.get_epoch_id().clone(),
BlockstackOperationType::LeaderBlockCommit(last_committed.get_block_commit().clone()),
&mut op_signer,
1,
);
let txid = match res {
Ok(txid) => txid,
Err(e) => {
if self.config.node.mock_mining {
debug!("Relayer: Mock-mining enabled; not sending Bitcoin transaction");
return Ok(());
}
warn!("Failed to submit block-commit bitcoin transaction: {e}");
NakamotoNodeError::BurnchainSubmissionFailed(e)
})?;
return Err(NakamotoNodeError::BurnchainSubmissionFailed(e));
}
};

info!(
"Relayer: Submitted block-commit";
Expand Down
Loading