aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-07-07 19:30:30 -0400
committerCarl Dong <contact@carldong.me>2022-07-12 22:37:17 -0400
commitc84390b741ab7b61c9f702d8b447c8cadc1257c8 (patch)
tree765fee2759e594a5ad94ad77365f9294e4637450
parent1d89fc695a3aeb3e3dcadf371b7667572b38c836 (diff)
test/mempool_persist: Test manual savemempool when -persistmempool=0
-rwxr-xr-xtest/functional/mempool_persist.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/functional/mempool_persist.py b/test/functional/mempool_persist.py
index 58f4c91343..b6fa7fbd91 100755
--- a/test/functional/mempool_persist.py
+++ b/test/functional/mempool_persist.py
@@ -141,6 +141,16 @@ class MempoolPersistTest(BitcoinTestFramework):
self.nodes[2].syncwithvalidationinterfacequeue() # Flush mempool to wallet
assert_equal(node2_balance, wallet_watch.getbalance())
+ mempooldat0 = os.path.join(self.nodes[0].datadir, self.chain, 'mempool.dat')
+ mempooldat1 = os.path.join(self.nodes[1].datadir, self.chain, 'mempool.dat')
+
+ self.log.debug("Force -persistmempool=0 node1 to savemempool to disk via RPC")
+ assert not os.path.exists(mempooldat1)
+ result1 = self.nodes[1].savemempool()
+ assert os.path.isfile(mempooldat1)
+ assert_equal(result1['filename'], mempooldat1)
+ os.remove(mempooldat1)
+
self.log.debug("Stop-start node0 with -persistmempool=0. Verify that it doesn't load its mempool.dat file.")
self.stop_nodes()
self.start_node(0, extra_args=["-persistmempool=0"])
@@ -153,8 +163,6 @@ class MempoolPersistTest(BitcoinTestFramework):
assert self.nodes[0].getmempoolinfo()["loaded"]
assert_equal(len(self.nodes[0].getrawmempool()), 7)
- mempooldat0 = os.path.join(self.nodes[0].datadir, self.chain, 'mempool.dat')
- mempooldat1 = os.path.join(self.nodes[1].datadir, self.chain, 'mempool.dat')
self.log.debug("Remove the mempool.dat file. Verify that savemempool to disk via RPC re-creates it")
os.remove(mempooldat0)
result0 = self.nodes[0].savemempool()