File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -423,23 +423,15 @@ impl<Signer: SignerTrait<T>, T: StacksMessageCodec + Clone + Send + Debug> RunLo
423
423
let mut to_delete = Vec :: new ( ) ;
424
424
for ( idx, signer) in & mut self . stacks_signers {
425
425
let reward_cycle = signer. reward_cycle ( ) ;
426
- let next_reward_cycle = reward_cycle. wrapping_add ( 1 ) ;
427
- let stale = match next_reward_cycle. cmp ( & current_reward_cycle) {
428
- std:: cmp:: Ordering :: Less => true , // We are more than one reward cycle behind, so we are stale
429
- std:: cmp:: Ordering :: Equal => {
430
- // We are the next reward cycle, so check if we were registered and have any pending blocks to process
431
- match signer {
432
- ConfiguredSigner :: RegisteredSigner ( signer) => {
433
- !signer. has_unprocessed_blocks ( )
434
- }
435
- _ => true ,
436
- }
426
+ if current_reward_cycle >= reward_cycle {
427
+ // We are either the current or a future reward cycle, so we are not stale.
428
+ continue ;
429
+ }
430
+ if let ConfiguredSigner :: RegisteredSigner ( signer) = signer {
431
+ if !signer. has_unprocessed_blocks ( ) {
432
+ debug ! ( "{signer}: Signer's tenure has completed." ) ;
433
+ to_delete. push ( * idx) ;
437
434
}
438
- std:: cmp:: Ordering :: Greater => false , // We are the current reward cycle, so we are not stale
439
- } ;
440
- if stale {
441
- debug ! ( "{signer}: Signer's tenure has completed." ) ;
442
- to_delete. push ( * idx) ;
443
435
}
444
436
}
445
437
for idx in to_delete {
You can’t perform that action at this time.
0 commit comments