mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: rm unused error variants (#14183)
This commit is contained in:
@ -189,10 +189,3 @@ pub enum InsertBlockValidationError {
|
||||
#[error(transparent)]
|
||||
Validation(#[from] BlockValidationError),
|
||||
}
|
||||
|
||||
impl InsertBlockValidationError {
|
||||
/// Returns true if this is a block pre merge error.
|
||||
pub const fn is_block_pre_merge(&self) -> bool {
|
||||
matches!(self, Self::Validation(BlockValidationError::BlockPreMerge { .. }))
|
||||
}
|
||||
}
|
||||
|
||||
@ -2592,12 +2592,7 @@ where
|
||||
// invalid headers cache and `Ok` with [PayloadStatusEnum::Invalid] is
|
||||
// returned.
|
||||
warn!(target: "engine::tree", invalid_hash=?block.hash(), invalid_number=?block.number(), %validation_err, "Invalid block error on new payload");
|
||||
let latest_valid_hash = if validation_err.is_block_pre_merge() {
|
||||
// zero hash must be returned if block is pre-merge
|
||||
Some(B256::ZERO)
|
||||
} else {
|
||||
self.latest_valid_hash_for_invalid_payload(block.parent_hash())?
|
||||
};
|
||||
let latest_valid_hash = self.latest_valid_hash_for_invalid_payload(block.parent_hash())?;
|
||||
|
||||
// keep track of the invalid header
|
||||
self.state.invalid_headers.insert(block.block_with_parent());
|
||||
|
||||
Reference in New Issue
Block a user