File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
testnet/stacks-node/src/nakamoto_node Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -669,20 +669,18 @@ impl BlockMinerThread {
669
669
return Ok ( ( ) ) ;
670
670
} ;
671
671
672
- // Wait for the last block to be processed before proceeding
673
672
if let Some ( last_block_mined) = & self . last_block_mined {
673
+ // Wait until the last block mined has been processed
674
674
loop {
675
- let ( stacks_tip_ch, stacks_tip_bh) =
676
- SortitionDB :: get_canonical_stacks_chain_tip_hash ( sortdb. conn ( ) ) . map_err (
677
- |e| {
678
- error ! ( "Failed to load canonical Stacks tip: {e:?}" ) ;
679
- NakamotoNodeError :: ParentNotFound
680
- } ,
681
- ) ?;
682
-
683
- if last_block_mined. header . consensus_hash == stacks_tip_ch
684
- && last_block_mined. header . block_hash ( ) == stacks_tip_bh
685
- {
675
+ let ( _, processed, _, _) = chain_state
676
+ . nakamoto_blocks_db ( )
677
+ . get_block_processed_and_signed_weight (
678
+ & last_block_mined. header . consensus_hash ,
679
+ & last_block_mined. header . block_hash ( ) ,
680
+ ) ?
681
+ . ok_or_else ( || NakamotoNodeError :: UnexpectedChainState ) ?;
682
+
683
+ if processed {
686
684
break ;
687
685
}
688
686
You can’t perform that action at this time.
0 commit comments