Don't include stakers with expired stakes in the missing_stakers results for StakingEscrowAgent.partition_stakers_by_activity()

pull/2764/head
derekpierre 2021-07-28 10:14:57 -04:00
parent b8ac12cb23
commit f1c850f479
1 changed files with 4 additions and 0 deletions

View File

@ -301,6 +301,10 @@ class StakingEscrowAgent(EthereumContractAgent):
elif last_committed_period == current_period:
pending_stakers.append(staker)
else:
locked_stake = self.non_withdrawable_stake(staker_address=staker)
if locked_stake == 0:
# don't include stakers with expired stakes
continue
missing_stakers.append(staker)
return active_stakers, pending_stakers, missing_stakers