MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / msg_headers

Class msg_headers

test/functional/test_framework/messages.py:1546–1564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1544# headers message has
1545# <count> <vector of block headers>
1546class 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
1567class msg_merkleblock:

Callers 15

run_testMethod · 0.90
run_testMethod · 0.90
ignores_cmpctblockMethod · 0.90
run_testMethod · 0.90
async_routineMethod · 0.90

Calls

no outgoing calls