mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Fix Eth1 data underflow (#977)
* Fix Eth1 data underflow #540 * Refactor: smart transformation from Option to Result * Add tests for BeaconState::get_outstanding_deposit_len()
This commit is contained in:
@@ -417,7 +417,7 @@ pub fn process_deposits<T: EthSpec>(
|
||||
) -> Result<(), BlockProcessingError> {
|
||||
let expected_deposit_len = std::cmp::min(
|
||||
T::MaxDeposits::to_u64(),
|
||||
state.eth1_data.deposit_count - state.eth1_deposit_index,
|
||||
state.get_outstanding_deposit_len()?,
|
||||
);
|
||||
block_verify!(
|
||||
deposits.len() as u64 == expected_deposit_len,
|
||||
|
||||
Reference in New Issue
Block a user