File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -363,9 +363,17 @@ impl NakamotoBlockProposal {
363
363
} ) ;
364
364
}
365
365
366
- let sort_tip = SortitionDB :: get_canonical_sortition_tip ( sortdb. conn ( ) ) ?;
367
- let burn_dbconn: SortitionHandleConn = sortdb. index_handle ( & sort_tip) ;
368
- let mut db_handle = sortdb. index_handle ( & sort_tip) ;
366
+ let sort_tip = SortitionDB :: get_block_snapshot_consensus (
367
+ sortdb. conn ( ) ,
368
+ & self . block . header . consensus_hash ,
369
+ ) ?
370
+ . ok_or_else ( || BlockValidateRejectReason {
371
+ reason_code : ValidateRejectCode :: NoSuchTenure ,
372
+ reason : "Failed to find sortition for block tenure" . to_string ( ) ,
373
+ } ) ?;
374
+
375
+ let burn_dbconn: SortitionHandleConn = sortdb. index_handle ( & sort_tip. sortition_id ) ;
376
+ let mut db_handle = sortdb. index_handle ( & sort_tip. sortition_id ) ;
369
377
370
378
// (For the signer)
371
379
// Verify that the block's tenure is on the canonical sortition history
You can’t perform that action at this time.
0 commit comments