Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_invalid_block.py
Show All 24 Lines | |||||
class InvalidBlockRequestTest(BitcoinTestFramework): | class InvalidBlockRequestTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.extra_args = [["-whitelist=127.0.0.1"]] | self.extra_args = [["-whitelist=127.0.0.1"]] | ||||
def skip_test_if_missing_module(self): | |||||
self.skip_if_no_wallet() | |||||
def run_test(self): | def run_test(self): | ||||
# Add p2p connection to node0 | # Add p2p connection to node0 | ||||
node = self.nodes[0] # convenience reference to the node | node = self.nodes[0] # convenience reference to the node | ||||
node.add_p2p_connection(P2PDataStore()) | node.add_p2p_connection(P2PDataStore()) | ||||
best_block = node.getblock(node.getbestblockhash()) | best_block = node.getblock(node.getbestblockhash()) | ||||
tip = int(node.getbestblockhash(), 16) | tip = int(node.getbestblockhash(), 16) | ||||
height = best_block["height"] + 1 | height = best_block["height"] + 1 | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |