Skip to content

Commit 6723d8e

Browse files
author
MarcoFalke
committed
Merge #14931: test: mempool_persist: Verify prioritization is dumped correctly
fa30a0e test: mempool_persist: Verify prioritization is dumped correctly (MarcoFalke) Pull request description: Tree-SHA512: ef39c470cd418443741b55e9765ee84e0a87a44e7756f88dea86df9b4d37a121a4fbcb97976fbe4693692691650fb1196093b7dadd3922359eb4720845d28f05
2 parents b53573e + fa30a0e commit 6723d8e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/functional/mempool_persist.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from test_framework.test_framework import BitcoinTestFramework
4343
from test_framework.util import assert_equal, assert_raises_rpc_error, wait_until
4444

45+
4546
class MempoolPersistTest(BitcoinTestFramework):
4647
def set_test_params(self):
4748
self.num_nodes = 3
@@ -60,14 +61,21 @@ def run_test(self):
6061

6162
self.log.debug("Send 5 transactions from node2 (to its own address)")
6263
for i in range(5):
63-
self.nodes[2].sendtoaddress(self.nodes[2].getnewaddress(), Decimal("10"))
64+
last_txid = self.nodes[2].sendtoaddress(self.nodes[2].getnewaddress(), Decimal("10"))
6465
node2_balance = self.nodes[2].getbalance()
6566
self.sync_all()
6667

6768
self.log.debug("Verify that node0 and node1 have 5 transactions in their mempools")
6869
assert_equal(len(self.nodes[0].getrawmempool()), 5)
6970
assert_equal(len(self.nodes[1].getrawmempool()), 5)
7071

72+
self.log.debug("Prioritize a transaction on node0")
73+
fees = self.nodes[0].getmempoolentry(txid=last_txid)['fees']
74+
assert_equal(fees['base'], fees['modified'])
75+
self.nodes[0].prioritisetransaction(txid=last_txid, fee_delta=1000)
76+
fees = self.nodes[0].getmempoolentry(txid=last_txid)['fees']
77+
assert_equal(fees['base'] + Decimal('0.00001000'), fees['modified'])
78+
7179
self.log.debug("Stop-start the nodes. Verify that node0 has the transactions in its mempool and node1 does not. Verify that node2 calculates its balance correctly after loading wallet transactions.")
7280
self.stop_nodes()
7381
# Give this node a head-start, so we can be "extra-sure" that it didn't load anything later
@@ -81,6 +89,10 @@ def run_test(self):
8189
# The others have loaded their mempool. If node_1 loaded anything, we'd probably notice by now:
8290
assert_equal(len(self.nodes[1].getrawmempool()), 0)
8391

92+
self.log.debug('Verify prioritization is loaded correctly')
93+
fees = self.nodes[0].getmempoolentry(txid=last_txid)['fees']
94+
assert_equal(fees['base'] + Decimal('0.00001000'), fees['modified'])
95+
8496
# Verify accounting of mempool transactions after restart is correct
8597
self.nodes[2].syncwithvalidationinterfacequeue() # Flush mempool to wallet
8698
assert_equal(node2_balance, self.nodes[2].getbalance())

0 commit comments

Comments
 (0)