Skip to content

Commit 1a87f5b

Browse files
authored
Merge pull request #5158 from stacks-network/fix/rbf-block-commit
fix: disregard tx count if the stacks tip has changed
2 parents f6bfe0a + 733dd79 commit 1a87f5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

testnet/stacks-node/src/neon_node.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,10 @@ impl BlockMinerThread {
17151715
info!("Relayer: Stacks tip has changed to {}/{} since we last tried to mine a block in {} at burn height {}; attempt was {} (for Stacks tip {}/{})",
17161716
parent_consensus_hash, stacks_parent_header.anchored_header.block_hash(), prev_block.burn_hash, parent_block_burn_height, prev_block.attempt, &prev_block.parent_consensus_hash, &prev_block.anchored_block.header.parent_block);
17171717
best_attempt = cmp::max(best_attempt, prev_block.attempt);
1718+
// Since the chain tip has changed, we should try to mine a new block, even
1719+
// if it has less transactions than the previous block we mined, since that
1720+
// previous block would now be a reorg.
1721+
max_txs = 0;
17181722
} else {
17191723
info!("Relayer: Burn tip has changed to {} ({}) since we last tried to mine a block in {}",
17201724
&self.burn_block.burn_header_hash, self.burn_block.block_height, &prev_block.burn_hash);

0 commit comments

Comments
 (0)