fix: make helper get_merkle_root works with no masternodes

This commit is contained in:
Konstantin Akimov 2024-11-23 02:42:22 +07:00
parent 7e0c2ca5a5
commit 8ea45bbf69
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -640,6 +640,8 @@ class CBlock(CBlockHeader):
# Calculate the merkle root given a vector of transaction hashes
@staticmethod
def get_merkle_root(hashes):
if len(hashes) == 0:
return 0
while len(hashes) > 1:
newhashes = []
for i in range(0, len(hashes), 2):