diff --git a/src/cascading_merkle_tree.rs b/src/cascading_merkle_tree.rs index 51e82aa..2d14974 100644 --- a/src/cascading_merkle_tree.rs +++ b/src/cascading_merkle_tree.rs @@ -362,7 +362,7 @@ where // If the index is out of bounds, we need to resize the storage // we must always have 2^n leaves for any n if new_last_leaf_index >= storage_len { - let next_power_of_two = (new_last_leaf_index + 1).next_power_of_two(); + let next_power_of_two = new_last_leaf_index.next_power_of_two(); let diff = next_power_of_two - storage_len; self.storage