Skip to content

Commit

Permalink
Merge pull request #7 from HerodotusDev/unnecessary-check-refactor
Browse files Browse the repository at this point in the history
delete unnecessary check
  • Loading branch information
rkdud007 authored Nov 4, 2023
2 parents e2df1df + a74f11b commit ba2609a
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/mmr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ where

let mut peaks = self.retrieve_peaks_hashes(find_peaks(elements_count), None)?;

let leaf_count = mmr_size_to_leaf_count(elements_count);
if leaf_count_to_peaks_count(leaf_count) as usize != peaks.len() {
return Err(anyhow!("Invalid peaks count".to_string()));
};

let mut last_element_idx = self.elements_count.increment()?;
let leaf_element_index = last_element_idx;

Expand Down

0 comments on commit ba2609a

Please sign in to comment.