Block 0 is valid in queries (#8891)

Early exit for block nr 0 leads to spurious error about pruning: `…your node is running with state pruning…`.

Fixes #7547, #8762
This commit is contained in:
David 2018-06-14 20:56:27 +02:00 committed by Andrew Jones
parent 24c2b8e3f6
commit bdef4b37a5

View File

@ -944,7 +944,8 @@ impl Client {
match id {
BlockId::Pending => self.state_at(BlockId::Latest),
id => 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)),
}
}