From 8ea45bbf69d4625819cadb98d2cb684d9e8163d1 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Sat, 23 Nov 2024 02:42:22 +0700 Subject: [PATCH] fix: make helper get_merkle_root works with no masternodes --- test/functional/test_framework/messages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index ae2c405e6e..2d8bf01180 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -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):