Skip to content

Commit

Permalink
fix(storage-proofs-porep): return last layer from Labels (#1685)
Browse files Browse the repository at this point in the history
An off-by-one error had caused `Labels::labels_for_last_layer` to return the second last layer.
  • Loading branch information
DrPeterVanNostrand authored Mar 22, 2023
1 parent bdb7c42 commit 963eb08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage-proofs-porep/src/stacked/vanilla/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ impl<Tree: MerkleTreeTrait> Labels<Tree> {

/// Returns label for the last layer.
pub fn labels_for_last_layer(&self) -> Result<DiskStore<<Tree::Hasher as Hasher>::Domain>> {
self.labels_for_layer(self.labels.len() - 1)
self.labels_for_layer(self.labels.len())
}

/// How many layers are available.
Expand Down

0 comments on commit 963eb08

Please sign in to comment.