mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-02 09:46:26 +00:00
fix underflow in deposit procesing (#1542)
This commit is contained in:
parent
61538fa581
commit
99e330d014
@ -290,10 +290,10 @@ proc process_operations(preset: RuntimePreset,
|
||||
# Verify that outstanding deposits are processed up to the maximum number of
|
||||
# deposits
|
||||
let
|
||||
num_deposits = uint64 len(body.deposits)
|
||||
req_deposits = min(MAX_DEPOSITS,
|
||||
state.eth1_data.deposit_count - state.eth1_deposit_index)
|
||||
if not (num_deposits == req_deposits):
|
||||
if state.eth1_data.deposit_count < state.eth1_deposit_index or
|
||||
body.deposits.lenu64 != req_deposits:
|
||||
return err("incorrect number of deposits")
|
||||
|
||||
template for_ops(operations: auto, fn: auto) =
|
||||
|
Loading…
x
Reference in New Issue
Block a user