Skip to content

Commit 40d3563

Browse files
committed
fix; revert change to Nakamoto block builder from PR feedback
1 parent f71a949 commit 40d3563

File tree

1 file changed

+7
-3
lines changed
  • testnet/stacks-node/src/nakamoto_node

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ pub struct BlockMinerThread {
139139
registered_key: RegisteredKey,
140140
/// Burnchain block snapshot which elected this miner
141141
burn_election_block: BlockSnapshot,
142-
/// Current burnchain tip
142+
/// Current burnchain tip as of the last TenureChange
143+
/// * if the last tenure-change was a BlockFound, then this is the same as the
144+
/// `burn_election_block`.
145+
/// * otherwise, if the last tenure-change is an Extend, then this is the sortition of the burn
146+
/// view consensus hash in the TenureChange
143147
burn_block: BlockSnapshot,
144148
/// The start of the parent tenure for this tenure
145149
parent_tenure_id: StacksBlockId,
@@ -1050,12 +1054,12 @@ impl BlockMinerThread {
10501054
let (mut block, consumed, size, tx_events) = NakamotoBlockBuilder::build_nakamoto_block(
10511055
&chain_state,
10521056
&burn_db
1053-
.index_handle_at_ch(&self.burn_election_block.consensus_hash)
1057+
.index_handle_at_ch(&self.burn_block.consensus_hash)
10541058
.map_err(|_| NakamotoNodeError::UnexpectedChainState)?,
10551059
&mut mem_pool,
10561060
&parent_block_info.stacks_parent_header,
10571061
&self.burn_election_block.consensus_hash,
1058-
self.burn_election_block.total_burn,
1062+
self.burn_block.total_burn,
10591063
tenure_start_info,
10601064
self.config
10611065
.make_nakamoto_block_builder_settings(self.globals.get_miner_status()),

0 commit comments

Comments
 (0)