Fix an off-by-one error in the maximum height of the tree.

This commit is contained in:
Kris Nuttycombe 2021-07-22 12:19:16 -06:00
parent 2f65f19fa6
commit 98c4dc8de2
1 changed files with 1 additions and 1 deletions

View File

@ -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<Item = Altitude> + '_ {
(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 {