File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -584,6 +584,14 @@ impl Signer {
584
584
// For mutability reasons, we need to take the block_info out of the map and add it back after processing
585
585
let mut block_info = match self . signer_db . block_lookup ( & signer_signature_hash) {
586
586
Ok ( Some ( block_info) ) => {
587
+ if block_info. reward_cycle != self . reward_cycle {
588
+ // We are not signing for this reward cycle. Ignore the block.
589
+ debug ! (
590
+ "{self}: Received a block validation response for a different reward cycle. Ignore it." ;
591
+ "requested_reward_cycle" => block_info. reward_cycle,
592
+ ) ;
593
+ return None ;
594
+ }
587
595
if block_info. is_locally_finalized ( ) {
588
596
debug ! ( "{self}: Received block validation for a block that is already marked as {}. Ignoring..." , block_info. state) ;
589
597
return None ;
@@ -655,6 +663,14 @@ impl Signer {
655
663
}
656
664
let mut block_info = match self . signer_db . block_lookup ( & signer_signature_hash) {
657
665
Ok ( Some ( block_info) ) => {
666
+ if block_info. reward_cycle != self . reward_cycle {
667
+ // We are not signing for this reward cycle. Ignore the block.
668
+ debug ! (
669
+ "{self}: Received a block validation response for a different reward cycle. Ignore it." ;
670
+ "requested_reward_cycle" => block_info. reward_cycle,
671
+ ) ;
672
+ return None ;
673
+ }
658
674
if block_info. is_locally_finalized ( ) {
659
675
debug ! ( "{self}: Received block validation for a block that is already marked as {}. Ignoring..." , block_info. state) ;
660
676
return None ;
You can’t perform that action at this time.
0 commit comments