| 1544 | # headers message has |
| 1545 | # <count> <vector of block headers> |
| 1546 | class msg_headers: |
| 1547 | __slots__ = ("headers",) |
| 1548 | msgtype = b"headers" |
| 1549 | |
| 1550 | def __init__(self, headers=None): |
| 1551 | self.headers = headers if headers is not None else [] |
| 1552 | |
| 1553 | def deserialize(self, f): |
| 1554 | # comment in bitcoind indicates these should be deserialized as blocks |
| 1555 | blocks = deser_vector(f, CBlock) |
| 1556 | for x in blocks: |
| 1557 | self.headers.append(CBlockHeader(x)) |
| 1558 | |
| 1559 | def serialize(self): |
| 1560 | blocks = [CBlock(x) for x in self.headers] |
| 1561 | return ser_vector(blocks) |
| 1562 | |
| 1563 | def __repr__(self): |
| 1564 | return "msg_headers(headers=%s)" % repr(self.headers) |
| 1565 | |
| 1566 | |
| 1567 | class msg_merkleblock: |
no outgoing calls