Skip to content

Commit 4e18e0f

Browse files
committed
fix: add comment when cloning proposed block's version
1 parent f8169d1 commit 4e18e0f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stackslib/src/net/api/postblock_proposal.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,9 @@ impl NakamotoBlockProposal {
538538
}
539539

540540
let mut block = builder.mine_nakamoto_block(&mut tenure_tx);
541+
// Override the block version with the one from the proposal. This must be
542+
// done before computing the block hash, because the block hash includes the
543+
// version in its computation.
541544
block.header.version = self.block.header.version;
542545
let size = builder.get_bytes_so_far();
543546
let cost = builder.tenure_finish(tenure_tx)?;

0 commit comments

Comments
 (0)