Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_invalid_locator.py
Show All 13 Lines | |||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
class InvalidLocatorTest(BitcoinTestFramework): | class InvalidLocatorTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.setup_clean_chain = False | self.setup_clean_chain = False | ||||
def skip_test_if_missing_module(self): | |||||
self.skip_if_no_wallet() | |||||
def run_test(self): | def run_test(self): | ||||
# Convenience reference to the node | # Convenience reference to the node | ||||
node = self.nodes[0] | node = self.nodes[0] | ||||
# Get node out of IBD | # Get node out of IBD | ||||
node.generate(1) | node.generatetoaddress(1, node.get_deterministic_priv_key().address) | ||||
self.log.info('Test max locator size') | self.log.info('Test max locator size') | ||||
block_count = node.getblockcount() | block_count = node.getblockcount() | ||||
for msg in [msg_getheaders(), msg_getblocks()]: | for msg in [msg_getheaders(), msg_getblocks()]: | ||||
self.log.info('Wait for disconnect when sending {} hashes in locator'.format( | self.log.info('Wait for disconnect when sending {} hashes in locator'.format( | ||||
MAX_LOCATOR_SZ + 1)) | MAX_LOCATOR_SZ + 1)) | ||||
node.add_p2p_connection(P2PInterface()) | node.add_p2p_connection(P2PInterface()) | ||||
msg.locator.vHave = [int(node.getblockhash( | msg.locator.vHave = [int(node.getblockhash( | ||||
Show All 19 Lines |