mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
test: Use int from_bytes and to_bytes over struct packing
This is done in prepration for the scripted diff, which can not deal with the 0 literal int.
This commit is contained in:
parent
fa3886b7c6
commit
fafc0d68ee
1 changed files with 2 additions and 2 deletions
|
@ -399,12 +399,12 @@ class CBlockLocator:
|
|||
self.vHave = []
|
||||
|
||||
def deserialize(self, f):
|
||||
struct.unpack("<i", f.read(4))[0] # Ignore version field.
|
||||
int.from_bytes(f.read(4), "little", signed=True) # Ignore version field.
|
||||
self.vHave = deser_uint256_vector(f)
|
||||
|
||||
def serialize(self):
|
||||
r = b""
|
||||
r += struct.pack("<i", 0) # Bitcoin Core ignores version field. Set it to 0.
|
||||
r += (0).to_bytes(4, "little", signed=True) # Bitcoin Core ignores the version field. Set it to 0.
|
||||
r += ser_uint256_vector(self.vHave)
|
||||
return r
|
||||
|
||||
|
|
Loading…
Reference in a new issue