Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/messages.py
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
MAX_LOCATOR_SZ = 101 | MAX_LOCATOR_SZ = 101 | ||||
MAX_BLOCK_BASE_SIZE = 1000000 | MAX_BLOCK_BASE_SIZE = 1000000 | ||||
MAX_BLOOM_FILTER_SIZE = 36000 | MAX_BLOOM_FILTER_SIZE = 36000 | ||||
MAX_BLOOM_HASH_FUNCS = 50 | MAX_BLOOM_HASH_FUNCS = 50 | ||||
# 1 BCH in satoshis | # 1 BCH in satoshis | ||||
COIN = 100000000 | COIN = 100000000 | ||||
# 1 XEC in satoshis | |||||
XEC = 100 | |||||
MAX_MONEY = 21000000 * COIN | MAX_MONEY = 21000000 * COIN | ||||
# Maximum length of incoming protocol messages | # Maximum length of incoming protocol messages | ||||
MAX_PROTOCOL_MESSAGE_LENGTH = 2 * 1024 * 1024 | MAX_PROTOCOL_MESSAGE_LENGTH = 2 * 1024 * 1024 | ||||
MAX_HEADERS_RESULTS = 2000 # Number of headers sent in one getheaders result | MAX_HEADERS_RESULTS = 2000 # Number of headers sent in one getheaders result | ||||
MAX_INV_SIZE = 50000 # Maximum number of entries in an 'inv' protocol message | MAX_INV_SIZE = 50000 # Maximum number of entries in an 'inv' protocol message | ||||
NODE_NETWORK = (1 << 0) | NODE_NETWORK = (1 << 0) | ||||
▲ Show 20 Lines • Show All 361 Lines • ▼ Show 20 Lines | class CTxOut: | ||||
def serialize(self): | def serialize(self): | ||||
r = b"" | r = b"" | ||||
r += struct.pack("<q", self.nValue) | r += struct.pack("<q", self.nValue) | ||||
r += ser_string(self.scriptPubKey) | r += ser_string(self.scriptPubKey) | ||||
return r | return r | ||||
def __repr__(self): | def __repr__(self): | ||||
return "CTxOut(nValue={}.{:08d} scriptPubKey={})".format( | return "CTxOut(nValue={}.{:02d} scriptPubKey={})".format( | ||||
self.nValue // COIN, self.nValue % COIN, self.scriptPubKey.hex()) | self.nValue // XEC, self.nValue % XEC, self.scriptPubKey.hex()) | ||||
class CTransaction: | class CTransaction: | ||||
__slots__ = ("hash", "nLockTime", "nVersion", "sha256", "vin", "vout") | __slots__ = ("hash", "nLockTime", "nVersion", "sha256", "vin", "vout") | ||||
def __init__(self, tx=None): | def __init__(self, tx=None): | ||||
if tx is None: | if tx is None: | ||||
self.nVersion = 1 | self.nVersion = 1 | ||||
▲ Show 20 Lines • Show All 1,649 Lines • Show Last 20 Lines |