Skip to content

Commit

Permalink
add comment about loops
Browse files Browse the repository at this point in the history
  • Loading branch information
TAdev0 committed Oct 3, 2024
1 parent af7df62 commit 9186a3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/consensus/src/types/utreexo.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ pub impl UtreexoAccumulatorImpl of UtreexoAccumulator {

let mut number_matched_roots: u32 = 0;

// Should we reverse *self.roots like in rustreexo to reduce the number of iteration?
for i in 0
..computed_roots
.len() {
Expand All @@ -262,8 +263,10 @@ pub impl UtreexoAccumulatorImpl of UtreexoAccumulator {
};
};
};

if (computed_roots.len() != number_matched_roots && computed_roots.len() != 0) {

let computed_roots_len = computed_roots.len();

if (computed_roots_len!= number_matched_roots && computed_roots_len != 0) {
return Result::Err(UtreexoError::ProofVerificationFailed);
}

Expand Down

0 comments on commit 9186a3d

Please sign in to comment.