mirror of https://github.com/nucypher/nucypher.git
Merge pull request #2764 from derekpierre/remove-expired-stakers
Don't include stakers with expired stakes in the `missing_stakers` results for `StakingEscrowAgent.partition_stakers_by_activity()`pull/2771/head
commit
614e4fa792
|
@ -0,0 +1 @@
|
|||
``StakingEscrow.partition_stakers_by_activity()`` no longer includes stakers with expired stakes in the ``missing_stakers`` value returned, thereby no longer overstating the number of inactive stakers.
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue