@@ -557,33 +557,6 @@ impl Signer {
557
557
self . handle_block_rejection ( block_rejection) ;
558
558
}
559
559
} ;
560
-
561
- // Remove this block validation from the pending table
562
- let signer_sig_hash = block_response. signer_signature_hash ( ) ;
563
- self . signer_db
564
- . remove_pending_block_validation ( & signer_sig_hash)
565
- . unwrap_or_else ( |e| warn ! ( "{self}: Failed to remove pending block validation: {e:?}" ) ) ;
566
-
567
- // Check if there is a pending block validation that we need to submit to the node
568
- match self . signer_db . get_pending_block_validation ( ) {
569
- Ok ( Some ( signer_sig_hash) ) => {
570
- info ! ( "{self}: Found a pending block validation: {signer_sig_hash:?}" ) ;
571
- match self . signer_db . block_lookup ( & signer_sig_hash) {
572
- Ok ( Some ( block_info) ) => {
573
- self . submit_block_for_validation ( stacks_client, & block_info. block ) ;
574
- }
575
- Ok ( None ) => {
576
- // This should never happen
577
- error ! (
578
- "{self}: Pending block validation not found in DB: {signer_sig_hash:?}"
579
- ) ;
580
- }
581
- Err ( e) => error ! ( "{self}: Failed to get block info: {e:?}" ) ,
582
- }
583
- }
584
- Ok ( None ) => { }
585
- Err ( e) => warn ! ( "{self}: Failed to get pending block validation: {e:?}" ) ,
586
- }
587
560
}
588
561
589
562
/// Handle the block validate ok response. Returns our block response if we have one
@@ -726,6 +699,12 @@ impl Signer {
726
699
self . handle_block_validate_reject ( block_validate_reject)
727
700
}
728
701
} ;
702
+ // Remove this block validation from the pending table
703
+ let signer_sig_hash = block_validate_response. signer_signature_hash ( ) ;
704
+ self . signer_db
705
+ . remove_pending_block_validation ( & signer_sig_hash)
706
+ . unwrap_or_else ( |e| warn ! ( "{self}: Failed to remove pending block validation: {e:?}" ) ) ;
707
+
729
708
let Some ( response) = block_response else {
730
709
return ;
731
710
} ;
@@ -745,6 +724,27 @@ impl Signer {
745
724
warn ! ( "{self}: Failed to send block rejection to stacker-db: {e:?}" , ) ;
746
725
}
747
726
}
727
+
728
+ // Check if there is a pending block validation that we need to submit to the node
729
+ match self . signer_db . get_pending_block_validation ( ) {
730
+ Ok ( Some ( signer_sig_hash) ) => {
731
+ info ! ( "{self}: Found a pending block validation: {signer_sig_hash:?}" ) ;
732
+ match self . signer_db . block_lookup ( & signer_sig_hash) {
733
+ Ok ( Some ( block_info) ) => {
734
+ self . submit_block_for_validation ( stacks_client, & block_info. block ) ;
735
+ }
736
+ Ok ( None ) => {
737
+ // This should never happen
738
+ error ! (
739
+ "{self}: Pending block validation not found in DB: {signer_sig_hash:?}"
740
+ ) ;
741
+ }
742
+ Err ( e) => error ! ( "{self}: Failed to get block info: {e:?}" ) ,
743
+ }
744
+ }
745
+ Ok ( None ) => { }
746
+ Err ( e) => warn ! ( "{self}: Failed to get pending block validation: {e:?}" ) ,
747
+ }
748
748
}
749
749
750
750
/// Check the current tracked submitted block proposal to see if it has timed out.
0 commit comments