aboutsummaryrefslogtreecommitdiff
path: root/test/functional/mempool_persist.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-06-09 16:35:17 -0400
committerJohn Newbery <john@johnnewbery.com>2017-09-01 12:25:54 -0400
commit36b626867087e9fae6d85f926248997ebff327b7 (patch)
treeecf522bb82c52e8c9c58bcd7839d550e71684ca4 /test/functional/mempool_persist.py
parentbe2a2ab6a67beef97e3c3cf42bd5eeea6c4e55cf (diff)
[tests] TestNode: separate add_node from start_node
Separates the act of creating a TestNode object from starting the node. The test_framework now keeps track of its list of TestNodes, and test writers can call start_node() and stop_node() without having to update the self.nodes list.
Diffstat (limited to 'test/functional/mempool_persist.py')
-rwxr-xr-xtest/functional/mempool_persist.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/functional/mempool_persist.py b/test/functional/mempool_persist.py
index 807edeb7a8..dc5a3263ff 100755
--- a/test/functional/mempool_persist.py
+++ b/test/functional/mempool_persist.py
@@ -63,9 +63,8 @@ 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)
wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)
@@ -73,16 +72,14 @@ class MempoolPersistTest(BitcoinTestFramework):
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))
+ self.start_node(0)
wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)
if __name__ == '__main__':