Skip to content

Commit

Permalink
hotfix: load the BurnStateDB implementation from the block's header's…
Browse files Browse the repository at this point in the history
… consensus_hash field, not the canonical tip
  • Loading branch information
jcnelson committed Nov 27, 2024
1 parent 40059a5 commit 7af0a11
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions stackslib/src/net/api/postblock_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,17 @@ impl NakamotoBlockProposal {
});
}

let sort_tip = SortitionDB::get_canonical_sortition_tip(sortdb.conn())?;
let burn_dbconn: SortitionHandleConn = sortdb.index_handle(&sort_tip);
let mut db_handle = sortdb.index_handle(&sort_tip);
let sort_tip = SortitionDB::get_block_snapshot_consensus(
sortdb.conn(),
&self.block.header.consensus_hash,
)?
.ok_or_else(|| BlockValidateRejectReason {
reason_code: ValidateRejectCode::NoSuchTenure,
reason: "Failed to find sortition for block tenure".to_string(),
})?;

let burn_dbconn: SortitionHandleConn = sortdb.index_handle(&sort_tip.sortition_id);
let mut db_handle = sortdb.index_handle(&sort_tip.sortition_id);

// (For the signer)
// Verify that the block's tenure is on the canonical sortition history
Expand Down

0 comments on commit 7af0a11

Please sign in to comment.