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("