Fix pending_balance_to_withdraw == 0 check when full exit

This commit is contained in:
Mikhail Kalinin 2024-03-27 15:44:38 +06:00
parent 5e32d442a2
commit 73ede3a804
1 changed files with 4 additions and 1 deletions

View File

@ -896,7 +896,10 @@ def process_execution_layer_withdraw_request(
item.amount for item in state.pending_partial_withdrawals if item.index == index item.amount for item in state.pending_partial_withdrawals if item.index == index
) )
# only exit validator if it has no pending withdrawals in the queue # only exit validator if it has no pending withdrawals in the queue
if is_full_exit_request and pending_balance_to_withdraw == 0: if is_full_exit_request and pending_balance_to_withdraw > 0:
return
if is_full_exit_request:
initiate_validator_exit(state, index) initiate_validator_exit(state, index)
elif state.balances[index] > MIN_ACTIVATION_BALANCE + pending_balance_to_withdraw: elif state.balances[index] > MIN_ACTIVATION_BALANCE + pending_balance_to_withdraw:
to_withdraw = min( to_withdraw = min(