|
12 | 12 |
|
13 | 13 | from datetime import timedelta |
14 | 14 |
|
15 | | -from test_framework.blocktools import COINBASE_MATURITY |
16 | 15 | from test_framework.messages import DEFAULT_MEMPOOL_EXPIRY_HOURS |
17 | 16 | from test_framework.test_framework import BitcoinTestFramework |
18 | 17 | from test_framework.util import ( |
|
27 | 26 | class MempoolExpiryTest(BitcoinTestFramework): |
28 | 27 | def set_test_params(self): |
29 | 28 | self.num_nodes = 1 |
30 | | - self.setup_clean_chain = True |
31 | 29 |
|
32 | 30 | def test_transaction_expiry(self, timeout): |
33 | 31 | """Tests that a transaction expires after the expiry timeout and its |
34 | 32 | children are removed as well.""" |
35 | 33 | node = self.nodes[0] |
36 | | - self.wallet = MiniWallet(node) |
37 | | - |
38 | | - # Add enough mature utxos to the wallet so that all txs spend confirmed coins. |
39 | | - self.generate(self.wallet, 4) |
40 | | - self.generate(node, COINBASE_MATURITY) |
41 | 34 |
|
42 | 35 | # Send a parent transaction that will expire. |
43 | 36 | parent_txid = self.wallet.send_self_transfer(from_node=node)['txid'] |
@@ -97,6 +90,8 @@ def test_transaction_expiry(self, timeout): |
97 | 90 | assert_equal(half_expiry_time, node.getmempoolentry(independent_txid)['time']) |
98 | 91 |
|
99 | 92 | def run_test(self): |
| 93 | + self.wallet = MiniWallet(self.nodes[0]) |
| 94 | + |
100 | 95 | self.log.info('Test default mempool expiry timeout of %d hours.' % |
101 | 96 | DEFAULT_MEMPOOL_EXPIRY_HOURS) |
102 | 97 | self.test_transaction_expiry(DEFAULT_MEMPOOL_EXPIRY_HOURS) |
|
0 commit comments