mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02: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:
@ -96,6 +96,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
"""Sets test framework defaults. Do not override this method. Instead, override the set_test_params() method"""
|
||||
self.chain: str = 'regtest'
|
||||
self.setup_clean_chain: bool = False
|
||||
self.noban_tx_relay: bool = False
|
||||
self.nodes: list[TestNode] = []
|
||||
self.extra_args = None
|
||||
self.network_thread = None
|
||||
@ -494,6 +495,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
extra_confs = [[]] * num_nodes
|
||||
if extra_args is None:
|
||||
extra_args = [[]] * num_nodes
|
||||
# Whitelist peers to speed up tx relay / mempool sync. Don't use it if testing tx relay or timing.
|
||||
if self.noban_tx_relay:
|
||||
for i in range(len(extra_args)):
|
||||
extra_args[i] = extra_args[i] + ["-whitelist=noban,in,out@127.0.0.1"]
|
||||
if versions is None:
|
||||
versions = [None] * num_nodes
|
||||
if binary is None:
|
||||
|
Reference in New Issue
Block a user