Skip to content

Commit

Permalink
Include rounds in the combined hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin-Radecki committed Jan 3, 2025
1 parent 888049a commit c9b9513
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions consensus/src/units/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@ impl<H: Hasher> ControlHash<H> {

/// Calculate parent control hash, which includes all parent hashes into account.
pub(crate) fn combine_hashes(parent_map: &NodeMap<(H::Hash, Round)>) -> H::Hash {
// TODO test without excluding rounds
let mut parents_hashes = NodeMap::with_size(parent_map.size());
for (parent_index, &(hash, _)) in parent_map.iter() {
parents_hashes.insert(parent_index, hash);
}
// we include parent rounds with calculating hash but this is okay - we cannot
// have two units with the same hash but different rounds
parent_map.using_encoded(H::hash)
}

Expand Down

0 comments on commit c9b9513

Please sign in to comment.