From 47f9565c15faec0ce35a17c68ade85af1dc41677 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 28 Apr 2025 20:16:50 +0000 Subject: [PATCH] Move node restart in test to better place. Needed because the previous test used -persistmempool=0 and we need to forget about the transaction it created. Credit: Sjors Provoost --- test/functional/mining_basic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/functional/mining_basic.py b/test/functional/mining_basic.py index cbb1cf789ef..49c80bfc943 100755 --- a/test/functional/mining_basic.py +++ b/test/functional/mining_basic.py @@ -186,6 +186,9 @@ class MiningTest(BitcoinTestFramework): assert tx_below_min_feerate['txid'] not in block_template_txids assert tx_below_min_feerate['txid'] not in block_txids + # Restart node to clear mempool for the next test + self.restart_node(0) + def test_timewarp(self): self.log.info("Test timewarp attack mitigation (BIP94)") node = self.nodes[0] @@ -279,11 +282,9 @@ class MiningTest(BitcoinTestFramework): def test_block_max_weight(self): self.log.info("Testing default and custom -blockmaxweight startup options.") - # Restart the node LARGE_TXS_COUNT = 10 LARGE_VSIZE = int(((MAX_BLOCK_WEIGHT - DEFAULT_BLOCK_RESERVED_WEIGHT) / WITNESS_SCALE_FACTOR) / LARGE_TXS_COUNT) HIGH_FEERATE = Decimal("0.0003") - self.restart_node(0) # Ensure the mempool is empty assert_equal(len(self.nodes[0].getrawmempool()), 0)