mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
client: hack around fork blocks deserialization issue (#4539)
This commit is contained in:
committed by
Bastian Köcher
parent
7efa62725e
commit
c72619ed71
@@ -1472,7 +1472,10 @@ impl<'a, B, E, Block, RA> sp_consensus::BlockImport<Block> for &'a Client<B, E,
|
||||
) -> Result<ImportResult, Self::Error> {
|
||||
let BlockCheckParams { hash, number, parent_hash, allow_missing_state, import_existing } = block;
|
||||
|
||||
if let Some(h) = self.fork_blocks.as_ref().and_then(|x| x.get(&number)) {
|
||||
let fork_block = self.fork_blocks.as_ref()
|
||||
.and_then(|fs| fs.iter().find(|(n, _)| *n == number));
|
||||
|
||||
if let Some((_, h)) = fork_block {
|
||||
if &hash != h {
|
||||
trace!(
|
||||
"Rejecting block from known invalid fork. Got {:?}, expected: {:?} at height {}",
|
||||
|
||||
Reference in New Issue
Block a user