Tests: Refactor to create witness script creation function

* Refactor blocktools.py so that witness script creation is its own function
* Changed p2p-segwit to use new function
This commit is contained in:
Jimmy Song
2017-04-17 09:23:44 -07:00
parent 987a6c0956
commit c39a6b9ec8
3 changed files with 14 additions and 13 deletions

View File

@@ -610,7 +610,8 @@ class CBlock(CBlockHeader):
return r
# Calculate the merkle root given a vector of transaction hashes
def get_merkle_root(self, hashes):
@classmethod
def get_merkle_root(cls, hashes):
while len(hashes) > 1:
newhashes = []
for i in range(0, len(hashes), 2):