From e6921144dc62fc5f1b81ab7094a12221286b2779 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Sun, 5 Jun 2016 22:05:01 +0200 Subject: [PATCH] simplify conditional in state_at --- ethcore/src/client/client.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 83b9e30ef..65cb13e4c 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -379,11 +379,8 @@ impl Client where V: Verifier { self.block_header(id).and_then(|header| { let db = self.state_db.lock().unwrap().boxed_clone(); - // check that the block is not too old -- blocks within `HISTORY` blocks of the best will - // always be available. If the block could be too old, check if its state root is valid. - let root = HeaderView::new(&header).state_root(); - let is_old = self.chain.best_block_number() >= block_number + HISTORY; - if db.is_pruned() && is_old && !db.contains(&root) { + // TODO [rob]: refactor State::from_existing so we avoid doing redundant lookups. + if !db.contains(&root) { return None; }