Skip to content

Commit

Permalink
Block 0 is valid in queries (openethereum#8891)
Browse files Browse the repository at this point in the history
Early exit for block nr 0 leads to spurious error about pruning: `…your node is running with state pruning…`.

Fixes openethereum#7547, openethereum#8762
  • Loading branch information
dvdplm authored and andresilva committed Jun 14, 2018
1 parent fd57100 commit 05e7c13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,8 @@ impl Client {
/// Otherwise, this can fail (but may not) if the DB prunes state.
pub fn state_at_beginning(&self, id: BlockId) -> Option<State<StateDB>> {
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)),
}
}
Expand Down

0 comments on commit 05e7c13

Please sign in to comment.