Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/messages.py
Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | def serialize(self): | ||||
r += struct.pack("<i", self.type) | r += struct.pack("<i", self.type) | ||||
r += ser_uint256(self.hash) | r += ser_uint256(self.hash) | ||||
return r | return r | ||||
def __repr__(self): | def __repr__(self): | ||||
return "CInv(type={} hash={:064x})".format( | return "CInv(type={} hash={:064x})".format( | ||||
self.typemap[self.type], self.hash) | self.typemap[self.type], self.hash) | ||||
def __eq__(self, other): | |||||
return isinstance( | |||||
other, CInv) and self.hash == other.hash and self.type == other.type | |||||
class CBlockLocator: | class CBlockLocator: | ||||
__slots__ = ("nVersion", "vHave") | __slots__ = ("nVersion", "vHave") | ||||
def __init__(self): | def __init__(self): | ||||
self.nVersion = MY_VERSION | self.nVersion = MY_VERSION | ||||
self.vHave = [] | self.vHave = [] | ||||
▲ Show 20 Lines • Show All 1,409 Lines • Show Last 20 Lines |