From 98c4dc8de25742acb3486a419147b48af9f3cdad Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Thu, 22 Jul 2021 12:19:16 -0600 Subject: [PATCH] Fix an off-by-one error in the maximum height of the tree. --- src/bridgetree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bridgetree.rs b/src/bridgetree.rs index c5ede35..0f840fb 100644 --- a/src/bridgetree.rs +++ b/src/bridgetree.rs @@ -61,7 +61,7 @@ impl Position { /// an authentication path to the root of a merkle tree that has `self + 1` /// nodes. pub fn altitudes_required(&self) -> impl Iterator + '_ { - (0..=(self.max_altitude() + 1).0) + (0..=self.max_altitude().0) .into_iter() .filter_map(move |i| { if self.0 == 0 || self.0 & (1 << i) == 0 {