diff --git a/tig-utils/src/merkle_tree.rs b/tig-utils/src/merkle_tree.rs index f6536ae8..6c402739 100644 --- a/tig-utils/src/merkle_tree.rs +++ b/tig-utils/src/merkle_tree.rs @@ -151,7 +151,7 @@ impl MerkleTree { } pub fn calc_merkle_proof(&self, branch_idx: usize) -> Result { - if branch_idx >= self.hashed_leafs.len() { + if branch_idx >= self.n { return Err(anyhow!("Invalid branch index")); }