| 1837 | |
| 1838 | |
| 1839 | class msg_pong: |
| 1840 | __slots__ = ("nonce",) |
| 1841 | msgtype = b"pong" |
| 1842 | |
| 1843 | def __init__(self, nonce=0): |
| 1844 | self.nonce = nonce |
| 1845 | |
| 1846 | def deserialize(self, f): |
| 1847 | self.nonce = struct.unpack("<Q", f.read(8))[0] |
| 1848 | |
| 1849 | def serialize(self): |
| 1850 | r = b"" |
| 1851 | r += struct.pack("<Q", self.nonce) |
| 1852 | return r |
| 1853 | |
| 1854 | def __repr__(self): |
| 1855 | return "msg_pong(nonce=%08x)" % self.nonce |
| 1856 | |
| 1857 | |
| 1858 | class msg_mempool: |