From 237460c533b2349137f4fe80cbd2c0479dc075fd Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Tue, 29 Oct 2024 14:39:24 +0700 Subject: [PATCH] fix: initialization of CMerkleBlock() due to misusage of default argument to follow-up bitcoin#30552 --- test/functional/test_framework/messages.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index d2f96e1efd..ac0cb3faa2 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -1069,9 +1069,15 @@ class CPartialMerkleTree: class CMerkleBlock: __slots__ = ("header", "txn") - def __init__(self, header=CBlockHeader(), txn=CPartialMerkleTree()): - self.header = header - self.txn = txn + def __init__(self, header=None, txn=None): + if header is None: + self.header = CBlockHeader() + else: + self.header = header + if txn is None: + self.txn = CPartialMerkleTree() + else: + self.txn = txn def deserialize(self, f): self.header.deserialize(f)