Skip to content

Commit c4b4635

Browse files
committed
Do not issue a BurnchainTipChanged error unless there is a new sortition
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent a2dcd4c commit c4b4635

File tree

1 file changed

+4
-1
lines changed
  • testnet/stacks-node/src/nakamoto_node

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,11 +1201,14 @@ impl BlockMinerThread {
12011201
}
12021202

12031203
/// Check if the tenure needs to change -- if so, return a BurnchainTipChanged error
1204+
/// The tenure should change if there is a new burnchain tip with a valid sortition
12041205
fn check_burn_tip_changed(&self, sortdb: &SortitionDB) -> Result<(), NakamotoNodeError> {
12051206
let cur_burn_chain_tip = SortitionDB::get_canonical_burn_chain_tip(sortdb.conn())
12061207
.expect("FATAL: failed to query sortition DB for canonical burn chain tip");
12071208

1208-
if cur_burn_chain_tip.consensus_hash != self.burn_block.consensus_hash {
1209+
if cur_burn_chain_tip.consensus_hash != self.burn_block.consensus_hash
1210+
&& cur_burn_chain_tip.sortition_id != self.burn_block.sortition_id
1211+
{
12091212
info!("Miner: Cancel block assembly; burnchain tip has changed");
12101213
self.globals.counters.bump_missed_tenures();
12111214
Err(NakamotoNodeError::BurnchainTipChanged)

0 commit comments

Comments
 (0)