mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 10:01:02 +00:00
find best_containing even if best chain is shorter (#3657)
This commit is contained in:
committed by
André Silva
parent
e434dbdfc5
commit
68cda2fe79
@@ -1704,10 +1704,10 @@ where
|
|||||||
|
|
||||||
let info = self.backend.blockchain().info();
|
let info = self.backend.blockchain().info();
|
||||||
|
|
||||||
let canon_hash = self.backend.blockchain().hash(*target_header.number())?
|
// this can be `None` if the best chain is shorter than the target header.
|
||||||
.ok_or_else(|| error::Error::from(format!("failed to get hash for block number {}", target_header.number())))?;
|
let maybe_canon_hash = self.backend.blockchain().hash(*target_header.number())?;
|
||||||
|
|
||||||
if canon_hash == target_hash {
|
if maybe_canon_hash.as_ref() == Some(&target_hash) {
|
||||||
// if a `max_number` is given we try to fetch the block at the
|
// if a `max_number` is given we try to fetch the block at the
|
||||||
// given depth, if it doesn't exist or `max_number` is not
|
// given depth, if it doesn't exist or `max_number` is not
|
||||||
// provided, we continue to search from all leaves below.
|
// provided, we continue to search from all leaves below.
|
||||||
|
|||||||
Reference in New Issue
Block a user