loadPieceLayer

Loads a file's whole piece layer (the per-piece roots) and validates it against the expectedRoot before committing. On success the piece layer and all of its ancestors up to the root are filled in. The block layer below the piece layer stays padding/unknown, so only piece-level nodes and above become meaningful, exactly like libtorrent's mode_t::piece_layer.

Direct analogue of merkle_tree::load_piece_layer: it returns false (and mutates nothing) when the supplied layer is the wrong size or fails to fold up to the known root.

Return

true if the piece layer validated and was loaded.

Parameters

pieces

exactly numPieces piece hashes, in order.