mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
fix: make helper get_merkle_root works with no masternodes
This commit is contained in:
parent
7e0c2ca5a5
commit
8ea45bbf69
@ -640,6 +640,8 @@ class CBlock(CBlockHeader):
|
|||||||
# Calculate the merkle root given a vector of transaction hashes
|
# Calculate the merkle root given a vector of transaction hashes
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_merkle_root(hashes):
|
def get_merkle_root(hashes):
|
||||||
|
if len(hashes) == 0:
|
||||||
|
return 0
|
||||||
while len(hashes) > 1:
|
while len(hashes) > 1:
|
||||||
newhashes = []
|
newhashes = []
|
||||||
for i in range(0, len(hashes), 2):
|
for i in range(0, len(hashes), 2):
|
||||||
|
Loading…
Reference in New Issue
Block a user