mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
test: add option to speed up tx relay/mempool sync
when `self.noban_tx_relay=True`, the following flag `-whitelist=noban,in,out@127.0.0.1`is added to `extra_args` to speed up tx relay/mempool sync.
This commit is contained in:
@@ -104,9 +104,8 @@ class ZMQTestSetupBlock:
|
||||
class ZMQTest (BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 2
|
||||
# This test isn't testing txn relay/timing, so set whitelist on the
|
||||
# peers for instant txn relay. This speeds up the test run time 2-3x.
|
||||
self.extra_args = [["-whitelist=noban@127.0.0.1"]] * self.num_nodes
|
||||
# whitelist peers to speed up tx relay / mempool sync
|
||||
self.noban_tx_relay = True
|
||||
self.zmq_port_base = p2p_port(self.num_nodes + 1)
|
||||
|
||||
def skip_test_if_missing_module(self):
|
||||
@@ -138,8 +137,7 @@ class ZMQTest (BitcoinTestFramework):
|
||||
socket.setsockopt(zmq.IPV6, 1)
|
||||
subscribers.append(ZMQSubscriber(socket, topic.encode()))
|
||||
|
||||
self.restart_node(0, [f"-zmqpub{topic}={address}" for topic, address in services] +
|
||||
self.extra_args[0])
|
||||
self.restart_node(0, [f"-zmqpub{topic}={address}" for topic, address in services])
|
||||
|
||||
for i, sub in enumerate(subscribers):
|
||||
sub.socket.connect(services[i][1])
|
||||
|
||||
Reference in New Issue
Block a user