@@ -540,9 +540,7 @@ impl Signer {
540
540
. block_lookup ( self . reward_cycle , & signer_signature_hash)
541
541
{
542
542
Ok ( Some ( block_info) ) => {
543
- if block_info. state == BlockState :: GloballyRejected
544
- || block_info. state == BlockState :: GloballyAccepted
545
- {
543
+ if block_info. is_locally_finalized ( ) {
546
544
debug ! ( "{self}: Received block validation for a block that is already marked as {}. Ignoring..." , block_info. state) ;
547
545
return None ;
548
546
}
@@ -559,8 +557,11 @@ impl Signer {
559
557
}
560
558
} ;
561
559
if let Err ( e) = block_info. mark_locally_accepted ( false ) {
562
- warn ! ( "{self}: Failed to mark block as locally accepted: {e:?}" , ) ;
563
- return None ;
560
+ if !block_info. has_reached_consensus ( ) {
561
+ warn ! ( "{self}: Failed to mark block as locally accepted: {e:?}" , ) ;
562
+ return None ;
563
+ }
564
+ block_info. signed_self . get_or_insert ( get_epoch_time_secs ( ) ) ;
564
565
}
565
566
let signature = self
566
567
. private_key
@@ -598,9 +599,7 @@ impl Signer {
598
599
. block_lookup ( self . reward_cycle , & signer_signature_hash)
599
600
{
600
601
Ok ( Some ( block_info) ) => {
601
- if block_info. state == BlockState :: GloballyRejected
602
- || block_info. state == BlockState :: GloballyAccepted
603
- {
602
+ if block_info. is_locally_finalized ( ) {
604
603
debug ! ( "{self}: Received block validation for a block that is already marked as {}. Ignoring..." , block_info. state) ;
605
604
return None ;
606
605
}
@@ -617,8 +616,10 @@ impl Signer {
617
616
}
618
617
} ;
619
618
if let Err ( e) = block_info. mark_locally_rejected ( ) {
620
- warn ! ( "{self}: Failed to mark block as locally rejected: {e:?}" , ) ;
621
- return None ;
619
+ if !block_info. has_reached_consensus ( ) {
620
+ warn ! ( "{self}: Failed to mark block as locally rejected: {e:?}" , ) ;
621
+ return None ;
622
+ }
622
623
}
623
624
let block_rejection = BlockRejection :: from_validate_rejection (
624
625
block_validate_reject. clone ( ) ,
0 commit comments