mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-04 17:00:52 +02:00
test: Fix CPartialMerkleTree.nTransactions signedness
This commit is contained in:
parent
aa9231fafe
commit
facafa90f7
@ -1063,7 +1063,7 @@ class CPartialMerkleTree:
|
|||||||
self.vBits = []
|
self.vBits = []
|
||||||
|
|
||||||
def deserialize(self, f):
|
def deserialize(self, f):
|
||||||
self.nTransactions = int.from_bytes(f.read(4), "little", signed=True)
|
self.nTransactions = int.from_bytes(f.read(4), "little")
|
||||||
self.vHash = deser_uint256_vector(f)
|
self.vHash = deser_uint256_vector(f)
|
||||||
vBytes = deser_string(f)
|
vBytes = deser_string(f)
|
||||||
self.vBits = []
|
self.vBits = []
|
||||||
@ -1072,7 +1072,7 @@ class CPartialMerkleTree:
|
|||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
r = b""
|
r = b""
|
||||||
r += self.nTransactions.to_bytes(4, "little", signed=True)
|
r += self.nTransactions.to_bytes(4, "little")
|
||||||
r += ser_uint256_vector(self.vHash)
|
r += ser_uint256_vector(self.vHash)
|
||||||
vBytesArray = bytearray([0x00] * ((len(self.vBits) + 7)//8))
|
vBytesArray = bytearray([0x00] * ((len(self.vBits) + 7)//8))
|
||||||
for i in range(len(self.vBits)):
|
for i in range(len(self.vBits)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user