bitcoin-sv / ts-sdk

Other
51 stars 13 forks source link

Tone merkle path trim #86

Closed tonesnotes closed 5 months ago

tonesnotes commented 5 months ago

Added trim() method to MerklePath which removes all computable leaves.

Added call to the new trim() method at the end of combine() so MerklePath size is minimized.

sirdeggen commented 5 months ago

Thanks gents taking a close look now.

sirdeggen commented 5 months ago

Something seems not quite right. I think when you feed it a BUMP with only the bottom level defined it doesn't realize there are supposed to be levels above it. The tree height is not set by the number of path elements on the bottom, but the number of arrays or something like that.