Stop panicking on side chain contextual validation (#1465)
Closes #1464.
This commit is contained in:
parent
c75a659d03
commit
3d9a2f1da5
|
@ -268,7 +268,6 @@ impl StateService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the height for the block at `hash` in any chain.
|
/// 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> {
|
pub fn any_height_by_hash(&self, hash: block::Hash) -> Option<block::Height> {
|
||||||
self.mem
|
self.mem
|
||||||
.any_height_by_hash(hash)
|
.any_height_by_hash(hash)
|
||||||
|
@ -516,7 +515,7 @@ impl ExactSizeIterator for Iter<'_> {
|
||||||
match self.state {
|
match self.state {
|
||||||
IterState::NonFinalized(hash) => self
|
IterState::NonFinalized(hash) => self
|
||||||
.service
|
.service
|
||||||
.best_height_by_hash(hash)
|
.any_height_by_hash(hash)
|
||||||
.map(|height| (height.0 + 1) as _)
|
.map(|height| (height.0 + 1) as _)
|
||||||
.unwrap_or(0),
|
.unwrap_or(0),
|
||||||
IterState::Finalized(height) => (height.0 + 1) as _,
|
IterState::Finalized(height) => (height.0 + 1) as _,
|
||||||
|
|
Loading…
Reference in New Issue