Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_filter.py
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | def set_test_params(self): | ||||
'-peerbloomfilters', | '-peerbloomfilters', | ||||
'-whitelist=noban@127.0.0.1', # immediate tx relay | '-whitelist=noban@127.0.0.1', # immediate tx relay | ||||
]] | ]] | ||||
def skip_test_if_missing_module(self): | def skip_test_if_missing_module(self): | ||||
self.skip_if_no_wallet() | self.skip_if_no_wallet() | ||||
def run_test(self): | def run_test(self): | ||||
self.log.info('Add filtered P2P connection to the node') | |||||
filter_node = self.nodes[0].add_p2p_connection(FilterNode()) | filter_node = self.nodes[0].add_p2p_connection(FilterNode()) | ||||
self.log.info('Check that too large filter is rejected') | |||||
with self.nodes[0].assert_debug_log(['Misbehaving']): | |||||
filter_node.send_and_ping( | |||||
msg_filterload( | |||||
data=b'\xaa', | |||||
nHashFuncs=51, | |||||
nTweak=0, | |||||
nFlags=1)) | |||||
self.log.info('Add filtered P2P connection to the node') | |||||
filter_node.send_and_ping(filter_node.watch_filter_init) | filter_node.send_and_ping(filter_node.watch_filter_init) | ||||
filter_address = self.nodes[0].decodescript( | filter_address = self.nodes[0].decodescript( | ||||
filter_node.watch_script_pubkey)['addresses'][0] | filter_node.watch_script_pubkey)['addresses'][0] | ||||
self.log.info( | self.log.info( | ||||
'Check that we receive merkleblock and tx if the filter matches a tx in a block') | 'Check that we receive merkleblock and tx if the filter matches a tx in a block') | ||||
block_hash = self.nodes[0].generatetoaddress(1, filter_address)[0] | block_hash = self.nodes[0].generatetoaddress(1, filter_address)[0] | ||||
txid = self.nodes[0].getblock(block_hash)['tx'][0] | txid = self.nodes[0].getblock(block_hash)['tx'][0] | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |