From 158e1a6f0f51296f80fc55e4e3b7712128f7a68b Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Mon, 11 Dec 2017 09:54:13 -1000 Subject: [PATCH] [QA] fix mininode CAddress ser/deser --- test/functional/test_framework/messages.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) mode change 100644 => 100755 test/functional/test_framework/messages.py diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py old mode 100644 new mode 100755 index a54a0299c7..ca92c51d3e --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -181,19 +181,24 @@ def ToHex(obj): class CAddress(): def __init__(self): + self.time = 0 self.nServices = 1 self.pchReserved = b"\x00" * 10 + b"\xff" * 2 self.ip = "0.0.0.0" self.port = 0 - def deserialize(self, f): + def deserialize(self, f, with_time=True): + if with_time: + self.time = struct.unpack("H", f.read(2))[0] - def serialize(self): + def serialize(self, with_time=True): r = b"" + if with_time: + r += struct.pack("= 106: self.addrFrom = CAddress() - self.addrFrom.deserialize(f) + self.addrFrom.deserialize(f, False) self.nNonce = struct.unpack("