aboutsummaryrefslogtreecommitdiff
path: root/test/functional/mempool_persist.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/mempool_persist.py')
-rwxr-xr-xtest/functional/mempool_persist.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/test/functional/mempool_persist.py b/test/functional/mempool_persist.py
index e0889fd5e9..01f65b1373 100755
--- a/test/functional/mempool_persist.py
+++ b/test/functional/mempool_persist.py
@@ -32,17 +32,12 @@ Test is as follows:
"""
import time
-from test_framework.mininode import wait_until
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class MempoolPersistTest(BitcoinTestFramework):
-
- def __init__(self):
- super().__init__()
- # We need 3 nodes for this test. Node1 does not have a persistent mempool.
+ def set_test_params(self):
self.num_nodes = 3
- self.setup_clean_chain = False
self.extra_args = [[], ["-persistmempool=0"], []]
def run_test(self):
@@ -64,27 +59,24 @@ class MempoolPersistTest(BitcoinTestFramework):
self.log.debug("Stop-start node0 and node1. Verify that node0 has the transactions in its mempool and node1 does not.")
self.stop_nodes()
- self.nodes = []
- self.nodes.append(self.start_node(0, self.options.tmpdir))
- self.nodes.append(self.start_node(1, self.options.tmpdir))
+ self.start_node(0)
+ self.start_node(1)
# Give bitcoind a second to reload the mempool
time.sleep(1)
- assert wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)
+ wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)
assert_equal(len(self.nodes[1].getrawmempool()), 0)
self.log.debug("Stop-start node0 with -persistmempool=0. Verify that it doesn't load its mempool.dat file.")
self.stop_nodes()
- self.nodes = []
- self.nodes.append(self.start_node(0, self.options.tmpdir, ["-persistmempool=0"]))
+ self.start_node(0, extra_args=["-persistmempool=0"])
# Give bitcoind a second to reload the mempool
time.sleep(1)
assert_equal(len(self.nodes[0].getrawmempool()), 0)
self.log.debug("Stop-start node0. Verify that it has the transactions in its mempool.")
self.stop_nodes()
- self.nodes = []
- self.nodes.append(self.start_node(0, self.options.tmpdir))
- assert wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)
+ self.start_node(0)
+ wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)
if __name__ == '__main__':
MempoolPersistTest().main()