mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Fix partial withdrawals count
This commit is contained in:
@@ -514,6 +514,7 @@ pub fn get_expected_withdrawals<E: EthSpec>(
|
|||||||
// Consume pending partial withdrawals
|
// Consume pending partial withdrawals
|
||||||
let partial_withdrawals_count =
|
let partial_withdrawals_count =
|
||||||
if let Ok(partial_withdrawals) = state.pending_partial_withdrawals() {
|
if let Ok(partial_withdrawals) = state.pending_partial_withdrawals() {
|
||||||
|
let mut partial_withdrawals_count = 0;
|
||||||
for withdrawal in partial_withdrawals {
|
for withdrawal in partial_withdrawals {
|
||||||
if withdrawal.withdrawable_epoch > epoch
|
if withdrawal.withdrawable_epoch > epoch
|
||||||
|| withdrawals.len() == spec.max_pending_partials_per_withdrawals_sweep as usize
|
|| withdrawals.len() == spec.max_pending_partials_per_withdrawals_sweep as usize
|
||||||
@@ -546,8 +547,9 @@ pub fn get_expected_withdrawals<E: EthSpec>(
|
|||||||
});
|
});
|
||||||
withdrawal_index.safe_add_assign(1)?;
|
withdrawal_index.safe_add_assign(1)?;
|
||||||
}
|
}
|
||||||
|
partial_withdrawals_count.safe_add_assign(1)?;
|
||||||
}
|
}
|
||||||
Some(withdrawals.len())
|
Some(partial_withdrawals_count)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user