programmingbitcoin
programmingbitcoin copied to clipboard
Ch 11. Improvement: Calculation of merkle depth items.
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