def deserialize(self, f, *, with_time=True):
    'Deserialize from addrv1 format (pre-BIP155)'
    if with_time:
        self.time = struct.unpack('<I', f.read(4))[0]
    self.nServices = struct.unpack('<Q', f.read(8))[0]
    f.read(12)
    self.net = self.NET_IPV4
    self.ip = socket.inet_ntoa(f.read(4))
    self.port = struct.unpack('>H', f.read(2))[0]
Deserialize from addrv1 format (pre-BIP155)
def deserialize(self, f, *, with_time=True):
    
    if with_time:
        self.time = struct.unpack('<I', f.read(4))[0]
    self.nServices = struct.unpack('<Q', f.read(8))[0]
    f.read(12)
    self.net = self.NET_IPV4
    self.ip = socket.inet_ntoa(f.read(4))
    self.port = struct.unpack('>H', f.read(2))[0]