Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/mininode.py
Show First 20 Lines • Show All 1,076 Lines • ▼ Show 20 Lines | def __repr__(self): | ||||
% (repr(self.locator), self.hashstop) | % (repr(self.locator), self.hashstop) | ||||
# headers message has | # headers message has | ||||
# <count> <vector of block headers> | # <count> <vector of block headers> | ||||
class msg_headers(): | class msg_headers(): | ||||
command = b"headers" | command = b"headers" | ||||
def __init__(self): | def __init__(self, headers=None): | ||||
self.headers = [] | self.headers = headers if headers is not None else [] | ||||
def deserialize(self, f): | def deserialize(self, f): | ||||
# comment in bitcoind indicates these should be deserialized as blocks | # comment in bitcoind indicates these should be deserialized as blocks | ||||
blocks = deser_vector(f, CBlock) | blocks = deser_vector(f, CBlock) | ||||
for x in blocks: | for x in blocks: | ||||
self.headers.append(CBlockHeader(x)) | self.headers.append(CBlockHeader(x)) | ||||
def serialize(self): | def serialize(self): | ||||
▲ Show 20 Lines • Show All 516 Lines • Show Last 20 Lines |