Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Block 0 is valid in queries (#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 #7547, #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.