def serialize(self):
    r = b''
    r += struct.pack('<i', self.nVersion)
    r += struct.pack('<Q', self.nServices)
    r += struct.pack('<q', self.nTime)
    r += self.addrTo.serialize(with_time=False)
    r += self.addrFrom.serialize(with_time=False)
    r += struct.pack('<Q', self.nNonce)
    r += ser_string(self.strSubVer.encode('utf-8'))
    r += struct.pack('<i', self.nStartingHeight)
    r += struct.pack('<b', self.relay)
    return r
def serialize(self):
    r = b
    r += struct.pack('<i', self.nVersion)
    r += struct.pack('<Q', self.nServices)
    r += struct.pack('<q', self.nTime)
    r += self.addrTo.serialize(with_time=False)
    r += self.addrFrom.serialize(with_time=False)
    r += struct.pack('<Q', self.nNonce)
    r += ser_string(self.strSubVer.encode('utf-8'))
    r += struct.pack('<i', self.nStartingHeight)
    r += struct.pack('<b', self.relay)
    return r