@@ -135,9 +135,13 @@ def check_smart_estimates(node, fees_seen):
135
135
delta = 1.0e-6 # account for rounding error
136
136
last_feerate = float (max (fees_seen ))
137
137
all_smart_estimates = [node .estimatesmartfee (i ) for i in range (1 , 26 )]
138
+ mempoolMinFee = node .getmempoolinfo ()['mempoolminfee' ]
139
+ minRelaytxFee = node .getmempoolinfo ()['minrelaytxfee' ]
138
140
for i , e in enumerate (all_smart_estimates ): # estimate is for i+1
139
141
feerate = float (e ["feerate" ])
140
142
assert_greater_than (feerate , 0 )
143
+ assert_greater_than_or_equal (feerate , float (mempoolMinFee ))
144
+ assert_greater_than_or_equal (feerate , float (minRelaytxFee ))
141
145
142
146
if feerate + delta < min (fees_seen ) or feerate - delta > max (fees_seen ):
143
147
raise AssertionError ("Estimated fee (%f) out of range (%f,%f)"
@@ -281,6 +285,13 @@ def run_test(self):
281
285
self .log .info ("Final estimates after emptying mempools" )
282
286
check_estimates (self .nodes [1 ], self .fees_per_kb )
283
287
288
+ # check that the effective feerate is greater than or equal to the mempoolminfee even for high mempoolminfee
289
+ self .log .info ("Test fee rate estimation after restarting node with high MempoolMinFee" )
290
+ high_val = 3 * self .nodes [1 ].estimatesmartfee (1 )['feerate' ]
291
+ self .restart_node (1 , extra_args = [f'-minrelaytxfee={ high_val } ' ])
292
+ check_estimates (self .nodes [1 ], self .fees_per_kb )
293
+ self .stop_node (1 , expected_stderr = "Warning: -minrelaytxfee is set very high! The wallet will avoid paying less than the minimum relay fee." )
294
+
284
295
self .log .info ("Testing that fee estimation is disabled in blocksonly." )
285
296
self .restart_node (0 , ["-blocksonly" ])
286
297
assert_raises_rpc_error (- 32603 , "Fee estimation disabled" ,
0 commit comments