| 1937 | # headers message has |
| 1938 | # <count> <vector of block headers> |
| 1939 | class msg_headers: |
| 1940 | __slots__ = ("headers",) |
| 1941 | msgtype = b"headers" |
| 1942 | |
| 1943 | def __init__(self, headers=None): |
| 1944 | self.headers = headers if headers is not None else [] |
| 1945 | |
| 1946 | def deserialize(self, f): |
| 1947 | # comment in bitcoind indicates these should be deserialized as blocks |
| 1948 | blocks = deser_vector(f, CBlock) |
| 1949 | for x in blocks: |
| 1950 | self.headers.append(CBlockHeader(x)) |
| 1951 | |
| 1952 | def serialize(self): |
| 1953 | blocks = [CBlock(x) for x in self.headers] |
| 1954 | return ser_vector(blocks) |
| 1955 | |
| 1956 | def __repr__(self): |
| 1957 | return "msg_headers(headers=%s)" % repr(self.headers) |
| 1958 | |
| 1959 | |
| 1960 | class msg_merkleblock: |
no outgoing calls