Skip to content

Fix padding bug in MerkleTree.ReadSegments

Created by: VoidingWarranties

Two things were wrong with the method.

  1. The method should not have been padding data.
  2. The function claimed to be padding with 0s but unless there was only one leaf it was actually padding data with the end of the previous leaf.

The fix was to make the corresponding unexported function in the merkletree repo an exported method. See PR NebulousLabs/merkletree#10. MerkleTree.ReadSegments now wraps this method instead of reimplementing it.

Merge request reports