From 54c086645b3dfeca24e629427461bb2cef5499f7 Mon Sep 17 00:00:00 2001 From: keorn Date: Tue, 11 Oct 2016 13:30:22 +0100 Subject: [PATCH] dont close block if is_invalid --- 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 d87f2d05e26..92f3cbeea75 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);