Change sorted[-1] to max() (#972)

This commit is contained in:
Diederik Loerakker 2019-04-20 18:13:45 +10:00 committed by Justin
parent 1a95996035
commit 75fae6f311
1 changed files with 1 additions and 1 deletions

View File

@ -1236,7 +1236,7 @@ def initiate_validator_exit(state: BeaconState, index: ValidatorIndex) -> None:
# Compute exit queue epoch # Compute exit queue epoch
exit_epochs = [v.exit_epoch for v in state.validator_registry if v.exit_epoch != FAR_FUTURE_EPOCH] exit_epochs = [v.exit_epoch for v in state.validator_registry if v.exit_epoch != FAR_FUTURE_EPOCH]
exit_queue_epoch = sorted(exit_epochs + [get_delayed_activation_exit_epoch(get_current_epoch(state))])[-1] exit_queue_epoch = max(exit_epochs + [get_delayed_activation_exit_epoch(get_current_epoch(state))])
exit_queue_churn = len([v for v in state.validator_registry if v.exit_epoch == exit_queue_epoch]) exit_queue_churn = len([v for v in state.validator_registry if v.exit_epoch == exit_queue_epoch])
if exit_queue_churn >= get_churn_limit(state): if exit_queue_churn >= get_churn_limit(state):
exit_queue_epoch += 1 exit_queue_epoch += 1