fix: initialization of CMerkleBlock() due to misusage of default argument to follow-up bitcoin#30552

This commit is contained in:
Konstantin Akimov 2024-10-29 14:39:24 +07:00
parent 79ced62d6f
commit 237460c533
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -1069,8 +1069,14 @@ class CPartialMerkleTree:
class CMerkleBlock:
__slots__ = ("header", "txn")
def __init__(self, header=CBlockHeader(), txn=CPartialMerkleTree()):
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):