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
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 committed Jun 13, 2018
1 parent b37b3cd commit 24dd29b
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 24dd29b

Please sign in to comment.