Stop panicking on side chain contextual validation (#1465)

Closes #1464.
This commit is contained in:
teor 2020-12-08 07:30:55 +10:00 committed by GitHub
parent c75a659d03
commit 3d9a2f1da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -268,7 +268,6 @@ impl StateService {
}
/// Return the height for the block at `hash` in any chain.
#[allow(dead_code)]
pub fn any_height_by_hash(&self, hash: block::Hash) -> Option<block::Height> {
self.mem
.any_height_by_hash(hash)
@ -516,7 +515,7 @@ impl ExactSizeIterator for Iter<'_> {
match self.state {
IterState::NonFinalized(hash) => self
.service
.best_height_by_hash(hash)
.any_height_by_hash(hash)
.map(|height| (height.0 + 1) as _)
.unwrap_or(0),
IterState::Finalized(height) => (height.0 + 1) as _,