From 36f8ca023970c44706365c224b49e47fb6868ac6 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 14 Jun 2018 20:56:27 +0200 Subject: [PATCH] Block 0 is valid in queries (#8891) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Early exit for block nr 0 leads to spurious error about pruning: `…your node is running with state pruning…`. Fixes #7547, #8762 --- ethcore/src/client/client.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 81d6ea9c970..7061ccc7165 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -999,7 +999,8 @@ impl Client { /// Otherwise, this can fail (but may not) if the DB prunes state. pub fn state_at_beginning(&self, id: BlockId) -> Option> { match self.block_number(id) { - None | Some(0) => None, + None => None, + Some(0) => self.state_at(id), Some(n) => self.state_at(BlockId::Number(n - 1)), } }