aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-01-31 22:53:21 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-01-31 22:56:34 +0100
commit438e6f4c3324ec48ab7daf4d4e77c3947ffc00cd (patch)
treedf4084b4c7dc3c6383aead219c299daca833ae92 /test
parent11b9684dfd3237c6cafc83e56b4aceeb3e3340fb (diff)
downloadbitcoin-438e6f4c3324ec48ab7daf4d4e77c3947ffc00cd.tar.xz
test: speedup interface_rest.py by whitelisting peers (immediate tx relay)
By whitelisting the peers via -whitelist, the inventory is transmissioned immediately rather than on average every 5 seconds, speeding up the test by at least a factor of two: before: $ time ./interface_rest.py ... 0m14.82s real 0m01.44s user 0m01.19s system with this commit: $ time ./interface_rest.py ... 0m05.67s real 0m01.07s user 0m01.35s system
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/interface_rest.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py
index 8eeff5e966..a3d949c6a8 100755
--- a/test/functional/interface_rest.py
+++ b/test/functional/interface_rest.py
@@ -52,6 +52,9 @@ class RESTTest (BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [["-rest", "-blockfilterindex=1"], []]
+ # whitelist peers to speed up tx relay / mempool sync
+ for args in self.extra_args:
+ args.append("-whitelist=noban@127.0.0.1")
self.supports_cli = False
def test_rest_request(self, uri, http_method='GET', req_type=ReqType.JSON, body='', status=200, ret_type=RetType.JSON):