mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: mark downloaded block as invalid if insertion fails (#3003)
This commit is contained in:
@ -1009,6 +1009,10 @@ where
|
||||
}
|
||||
Err(err) => {
|
||||
debug!(target: "consensus::engine", ?err, "Failed to insert downloaded block");
|
||||
if !matches!(err.kind(), InsertBlockErrorKind::Internal(_)) {
|
||||
// non-internal error kinds occurr if the payload is invalid
|
||||
self.invalid_headers.insert(err.into_block().header);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user