mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 05:11:02 +00:00
Avoid hashing headers twice in verify_justification (#973)
This commit is contained in:
committed by
Bastian Köcher
parent
f8f8f42a89
commit
b6efe6f740
@@ -109,12 +109,8 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let ancestry_hashes = justification
|
// both iterators are `BTree*` iterators, so have the same order => safe to compare
|
||||||
.votes_ancestries
|
if !visited_hashes.iter().eq(ancestry_chain.ancestry.keys()) {
|
||||||
.iter()
|
|
||||||
.map(|h: &Header| h.hash())
|
|
||||||
.collect();
|
|
||||||
if visited_hashes != ancestry_hashes {
|
|
||||||
return Err(Error::InvalidPrecommitAncestries);
|
return Err(Error::InvalidPrecommitAncestries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user