Made topping up a withdrawn account impossible
This commit is contained in:
parent
8b8253cdb2
commit
efdafee1ad
|
@ -783,14 +783,12 @@ def add_validator(state: State,
|
||||||
state.validators[index] = rec
|
state.validators[index] = rec
|
||||||
return index
|
return index
|
||||||
else:
|
else:
|
||||||
|
assert val.status != WITHDRAWN
|
||||||
index = validator_pubkeys.index(pubkey)
|
index = validator_pubkeys.index(pubkey)
|
||||||
val = state.validators[index]
|
val = state.validators[index]
|
||||||
assert val.withdrawal_credentials == withdrawal_credentials
|
assert val.withdrawal_credentials == withdrawal_credentials
|
||||||
assert deposit_size >= MIN_TOPUP_SIZE
|
assert deposit_size >= MIN_TOPUP_SIZE
|
||||||
val.balance += deposit_size
|
val.balance += deposit_size
|
||||||
# If the validator is withdrawn, overwrite it with the new validator data
|
|
||||||
if val.status == WITHDRAWN:
|
|
||||||
state.validators[index] = rec
|
|
||||||
return index
|
return index
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue