mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Fix Bug In Block Processing with 0x02 Credentials
This commit is contained in:
@@ -566,7 +566,7 @@ pub fn get_expected_withdrawals<E: EthSpec>(
|
||||
index: withdrawal_index,
|
||||
validator_index,
|
||||
address: validator
|
||||
.get_eth1_withdrawal_address(spec)
|
||||
.get_execution_withdrawal_address(spec)
|
||||
.ok_or(BlockProcessingError::WithdrawalCredentialsInvalid)?,
|
||||
amount: balance,
|
||||
});
|
||||
@@ -576,7 +576,7 @@ pub fn get_expected_withdrawals<E: EthSpec>(
|
||||
index: withdrawal_index,
|
||||
validator_index,
|
||||
address: validator
|
||||
.get_eth1_withdrawal_address(spec)
|
||||
.get_execution_withdrawal_address(spec)
|
||||
.ok_or(BlockProcessingError::WithdrawalCredentialsInvalid)?,
|
||||
amount: balance.safe_sub(
|
||||
validator
|
||||
|
||||
@@ -140,18 +140,6 @@ impl Validator {
|
||||
is_compounding_withdrawal_credential(self.withdrawal_credentials, spec)
|
||||
}
|
||||
|
||||
/// Get the eth1 withdrawal address if this validator has one initialized.
|
||||
pub fn get_eth1_withdrawal_address(&self, spec: &ChainSpec) -> Option<Address> {
|
||||
self.has_eth1_withdrawal_credential(spec)
|
||||
.then(|| {
|
||||
self.withdrawal_credentials
|
||||
.as_bytes()
|
||||
.get(12..)
|
||||
.map(Address::from_slice)
|
||||
})
|
||||
.flatten()
|
||||
}
|
||||
|
||||
/// Get the execution withdrawal address if this validator has one initialized.
|
||||
pub fn get_execution_withdrawal_address(&self, spec: &ChainSpec) -> Option<Address> {
|
||||
self.has_execution_withdrawal_credential(spec)
|
||||
|
||||
Reference in New Issue
Block a user