@@ -41,6 +41,12 @@ def clear_invs(self):
41
41
class FeeFilterTest (BitcoinTestFramework ):
42
42
def set_test_params (self ):
43
43
self .num_nodes = 2
44
+ # We lower the various required feerates for this test
45
+ # to catch a corner-case where feefilter used to slightly undercut
46
+ # mempool and wallet feerate calculation based on GetFee
47
+ # rounding down 3 places, leading to stranded transactions.
48
+ # See issue #16499
49
+ self .extra_args = [["-minrelaytxfee=0.00000100" , "-mintxfee=0.00000100" ]]* self .num_nodes
44
50
45
51
def skip_test_if_missing_module (self ):
46
52
self .skip_if_no_wallet ()
@@ -54,22 +60,25 @@ def run_test(self):
54
60
55
61
self .nodes [0 ].add_p2p_connection (TestP2PConn ())
56
62
57
- # Test that invs are received for all txs at feerate of 20 sat/byte
58
- node1 .settxfee (Decimal ("0.00020000" ))
63
+ # Test that invs are received by test connection for all txs at
64
+ # feerate of .2 sat/byte
65
+ node1 .settxfee (Decimal ("0.00000200" ))
59
66
txids = [node1 .sendtoaddress (node1 .getnewaddress (), 1 ) for x in range (3 )]
60
67
assert allInvsMatch (txids , self .nodes [0 ].p2p )
61
68
self .nodes [0 ].p2p .clear_invs ()
62
69
63
- # Set a filter of 15 sat/byte
64
- self .nodes [0 ].p2p .send_and_ping (msg_feefilter (15000 ))
70
+ # Set a filter of . 15 sat/byte on test connection
71
+ self .nodes [0 ].p2p .send_and_ping (msg_feefilter (150 ))
65
72
66
- # Test that txs are still being received (paying 20 sat/byte)
73
+ # Test that txs are still being received by test connection (paying .15 sat/byte)
74
+ node1 .settxfee (Decimal ("0.00000150" ))
67
75
txids = [node1 .sendtoaddress (node1 .getnewaddress (), 1 ) for x in range (3 )]
68
76
assert allInvsMatch (txids , self .nodes [0 ].p2p )
69
77
self .nodes [0 ].p2p .clear_invs ()
70
78
71
- # Change tx fee rate to 10 sat/byte and test they are no longer received
72
- node1 .settxfee (Decimal ("0.00010000" ))
79
+ # Change tx fee rate to .1 sat/byte and test they are no longer received
80
+ # by the test connection
81
+ node1 .settxfee (Decimal ("0.00000100" ))
73
82
[node1 .sendtoaddress (node1 .getnewaddress (), 1 ) for x in range (3 )]
74
83
self .sync_mempools () # must be sure node 0 has received all txs
75
84
0 commit comments