mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: dont include latest valid hash on block hash error (#2523)
This commit is contained in:
@ -485,9 +485,17 @@ where
|
||||
Ok(block) => block,
|
||||
Err(error) => {
|
||||
error!(target: "consensus::engine", ?block_hash, block_number, ?error, "Invalid payload");
|
||||
let latest_valid_hash =
|
||||
self.latest_valid_hash_for_invalid_payload(parent_hash, None);
|
||||
return PayloadStatus::from(error).maybe_latest_valid_hash(latest_valid_hash)
|
||||
|
||||
let mut latest_valid_hash = None;
|
||||
if !error.is_block_hash_mismatch() {
|
||||
// Engine-API rule:
|
||||
// > `latestValidHash: null` if the blockHash validation has failed
|
||||
latest_valid_hash =
|
||||
self.latest_valid_hash_for_invalid_payload(parent_hash, None);
|
||||
}
|
||||
let status = PayloadStatusEnum::from(error);
|
||||
|
||||
return PayloadStatus::new(status, latest_valid_hash)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user