@@ -682,15 +682,6 @@ impl BlockMinerThread {
682
682
reward_set : & RewardSet ,
683
683
stackerdbs : & StackerDBs ,
684
684
) -> Result < ( ) , NakamotoNodeError > {
685
- let mut chain_state = neon_node:: open_chainstate_with_faults ( & self . config )
686
- . expect ( "FATAL: could not open chainstate DB" ) ;
687
- let sort_db = SortitionDB :: open (
688
- & self . config . get_burn_db_file_path ( ) ,
689
- true ,
690
- self . burnchain . pox_constants . clone ( ) ,
691
- )
692
- . expect ( "FATAL: could not open sortition DB" ) ;
693
-
694
685
if self . config . get_node_config ( false ) . mock_mining {
695
686
// If we're mock mining, we don't actually broadcast the block.
696
687
return Ok ( ( ) ) ;
@@ -702,6 +693,15 @@ impl BlockMinerThread {
702
693
) ) ;
703
694
} ;
704
695
696
+ let mut chain_state = neon_node:: open_chainstate_with_faults ( & self . config )
697
+ . expect ( "FATAL: could not open chainstate DB" ) ;
698
+ let sort_db = SortitionDB :: open (
699
+ & self . config . get_burn_db_file_path ( ) ,
700
+ true ,
701
+ self . burnchain . pox_constants . clone ( ) ,
702
+ )
703
+ . expect ( "FATAL: could not open sortition DB" ) ;
704
+
705
705
// push block via p2p block push
706
706
self . broadcast_p2p ( & sort_db, & mut chain_state, & block, reward_set)
707
707
. map_err ( NakamotoNodeError :: AcceptFailure ) ?;
0 commit comments