mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 02:51:01 +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
|
||||
.votes_ancestries
|
||||
.iter()
|
||||
.map(|h: &Header| h.hash())
|
||||
.collect();
|
||||
if visited_hashes != ancestry_hashes {
|
||||
// both iterators are `BTree*` iterators, so have the same order => safe to compare
|
||||
if !visited_hashes.iter().eq(ancestry_chain.ancestry.keys()) {
|
||||
return Err(Error::InvalidPrecommitAncestries);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user