verifyPieceLeaves

fun verifyPieceLeaves(pieceIndex: Int, leaves: List<Sha256Hash>): Boolean

Verifies a run of a single piece's block-leaf hashes against that piece's already-known piece-layer root, without marking anything. Folds the supplied leaves (padded as needed) and compares to the stored piece root.

Return

true iff the leaves fold to the stored (non-zero) piece root.

Parameters

pieceIndex

the piece whose leaves these are, in [0, numPieces()).

leaves

the piece's block hashes, in order. Up to blocksPerPiece entries; a short trailing run is padded with the all-zero block hash.