Skip to content

Commit

Permalink
get_proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdud007 committed Jan 22, 2024
1 parent 4aaab0d commit 61d5bf5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mmr/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ impl MMR {
options: Option<ProofOptions>,
) -> Result<Vec<Proof>, MMRError> {
let options = options.unwrap_or_default();
let element_count = self.elements_count.get().await?;
let tree_size = options.elements_count.unwrap_or(element_count);
let tree_size = if let Some(count) = options.elements_count {
count
} else {
self.elements_count.get().await?
};

for &element_index in &elements_indexes {
if element_index == 0 {
Expand Down

0 comments on commit 61d5bf5

Please sign in to comment.