Skip to content

Commit

Permalink
Make CBlock.get_merkle_root static
Browse files Browse the repository at this point in the history
We'll later need this method to calculate merkle roots outside of CBlock.
I'd like to avoid moving this code outside of CBlock as it might later
conflict with Bitcoin backports.
  • Loading branch information
codablock committed Apr 4, 2019
1 parent 1e0bdbc commit 585b9c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qa/rpc-tests/test_framework/mininode.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ def serialize(self):
return r

# Calculate the merkle root given a vector of transaction hashes
def get_merkle_root(self, hashes):
@staticmethod
def get_merkle_root(hashes):
while len(hashes) > 1:
newhashes = []
for i in range(0, len(hashes), 2):
Expand Down

0 comments on commit 585b9c2

Please sign in to comment.