Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_compactblocks.py
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | def wait_for_block_announcement(self, block_hash, timeout=30): | ||||
wait_until(received_hash, timeout=timeout, lock=mininode_lock) | wait_until(received_hash, timeout=timeout, lock=mininode_lock) | ||||
def send_await_disconnect(self, message, timeout=30): | def send_await_disconnect(self, message, timeout=30): | ||||
"""Sends a message to the node and wait for disconnect. | """Sends a message to the node and wait for disconnect. | ||||
This is used when we want to send a message into the node that we expect | This is used when we want to send a message into the node that we expect | ||||
will get us disconnected, eg an invalid block.""" | will get us disconnected, eg an invalid block.""" | ||||
self.send_message(message) | self.send_message(message) | ||||
wait_until(lambda: self.state != "connected", | wait_until(lambda: not self.is_connected, | ||||
timeout=timeout, lock=mininode_lock) | timeout=timeout, lock=mininode_lock) | ||||
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"]] | ||||
▲ Show 20 Lines • Show All 795 Lines • Show Last 20 Lines |