programmingbitcoin icon indicating copy to clipboard operation
programmingbitcoin copied to clipboard

Ch 11. Improvement: Calculation of merkle depth items.

Open sjorsvanheuveln opened this issue 4 years ago • 0 comments

This: num_items = math.ceil(self.total / 2**(self.max_depth - depth))

Can be simplified to this: num_items = 2**depth

For depth 0 to and including max_depth

sjorsvanheuveln avatar Oct 29 '21 15:10 sjorsvanheuveln