From 5e24a35272a99ad002c5d065a7335525eb2ce769 Mon Sep 17 00:00:00 2001 From: keorn Date: Tue, 11 Oct 2016 15:19:00 +0100 Subject: [PATCH] dont close block if is_invalid (#2572) --- ethcore/src/client/client.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index d87f2d05e..92f3cbeea 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -354,7 +354,11 @@ impl Client { for block in blocks { let header = &block.header; let is_invalid = invalid_blocks.contains(header.parent_hash()); - if let (false, Ok(closed_block)) = (is_invalid, self.check_and_close_block(&block)) { + if is_invalid { + invalid_blocks.insert(header.hash()); + continue; + } + if let Ok(closed_block) = self.check_and_close_block(&block) { imported_blocks.push(header.hash()); let route = self.commit_block(closed_block, &header.hash(), &block.bytes);