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

Class msg_headers

test/functional/test_framework/messages.py:1280–1297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1278# headers message has
1279# <count> <vector of block headers>
1280class msg_headers():
1281 command = b"headers"
1282
1283 def __init__(self, headers=None):
1284 self.headers = headers if headers is not None else []
1285
1286 def deserialize(self, f):
1287 # comment in bitcoind indicates these should be deserialized as blocks
1288 blocks = deser_vector(f, CBlock, legacy=False)
1289 for x in blocks:
1290 self.headers.append(CBlockHeader(x))
1291
1292 def serialize(self):
1293 blocks = [CBlock(x) for x in self.headers]
1294 return ser_vector(blocks, legacy=False)
1295
1296 def __repr__(self):
1297 return "msg_headers(headers=%s)" % repr(self.headers)
1298
1299
1300class msg_reject():

Callers 9

run_testMethod · 0.90
test_block_relayMethod · 0.90
on_getheadersMethod · 0.90
send_blocks_and_testMethod · 0.90
run_testMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_block_relayMethod · 0.72