Skip to content

Commit 2d3dc50

Browse files
committed
fix: correct logic handling submit_operation errors
1 parent 1c13216 commit 2d3dc50

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

testnet/stacks-node/src/neon_node.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,19 +2753,21 @@ impl BlockMinerThread {
27532753
} = self.config.get_node_config(false);
27542754

27552755
let res = bitcoin_controller.submit_operation(target_epoch_id, op, &mut op_signer, attempt);
2756-
self.failed_to_submit_last_attempt = match res {
2757-
Ok(_) => false,
2758-
Err(BurnchainControllerError::IdenticalOperation) => {
2759-
info!("Relayer: Block-commit already submitted");
2760-
true
2761-
}
2756+
match res {
2757+
Ok(_) => self.failed_to_submit_last_attempt = false,
27622758
Err(_) if mock_mining => {
27632759
debug!("Relayer: Mock-mining enabled; not sending Bitcoin transaction");
2764-
true
2760+
self.failed_to_submit_last_attempt = true;
2761+
}
2762+
Err(BurnchainControllerError::IdenticalOperation) => {
2763+
info!("Relayer: Block-commit already submitted");
2764+
self.failed_to_submit_last_attempt = true;
2765+
return None;
27652766
}
27662767
Err(e) => {
27672768
warn!("Relayer: Failed to submit Bitcoin transaction: {:?}", e);
2768-
true
2769+
self.failed_to_submit_last_attempt = true;
2770+
return None;
27692771
}
27702772
};
27712773

0 commit comments

Comments
 (0)