Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_compactblocks.py
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | |||||
class CompactBlocksTest(BitcoinTestFramework): | class CompactBlocksTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 2 | self.num_nodes = 2 | ||||
self.extra_args = [[], ["-txindex"]] | self.extra_args = [[], ["-txindex"]] | ||||
self.utxos = [] | self.utxos = [] | ||||
def skip_test_if_missing_module(self): | |||||
self.skip_if_no_wallet() | |||||
def build_block_on_tip(self, node): | def build_block_on_tip(self, node): | ||||
height = node.getblockcount() | height = node.getblockcount() | ||||
tip = node.getbestblockhash() | tip = node.getbestblockhash() | ||||
mtp = node.getblockheader(tip)['mediantime'] | mtp = node.getblockheader(tip)['mediantime'] | ||||
block = create_block( | block = create_block( | ||||
int(tip, 16), create_coinbase(height + 1), mtp + 1) | int(tip, 16), create_coinbase(height + 1), mtp + 1) | ||||
block.nVersion = 4 | block.nVersion = 4 | ||||
block.solve() | block.solve() | ||||
▲ Show 20 Lines • Show All 781 Lines • Show Last 20 Lines |