Skip to content
Snippets Groups Projects
Commit b6efe6f7 authored by Svyatoslav Nikolsky's avatar Svyatoslav Nikolsky Committed by Bastian Köcher
Browse files

Avoid hashing headers twice in verify_justification (#973)

parent f8f8f42a
No related merge requests found
......@@ -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);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment