Attempt to fix #32461
In the estimatesmartfee
RPC, we return the maximum of the following: the feerate estimate for the target, minrelaytxfee
, and mempoolminfee
.
The test test_feerate_mempoolminfee
, originally introduced in https://github.com/bitcoin/bitcoin/commit/ea31caf6b4c182c6f10f136548f84e603800511c, is incorrect.
It should append the higher value used to start the node (i.e., the custom minrelaytxfee
) to the list of seen fees in self.fees_per_kb
before checking smart fees since there is no certainty that we had generate a value higher than it, which it currently does not do.
Due to the non-deterministic behavior of the feature_fee_estimation.py
test, the randomly generated fees include a value higher than the custom minrelaytxfee
, causing the test to pass.
Issue #32461 discover a seed that generates random fees where none exceed the custom minrelaytxfee
value, causing the test to reliably fail:
0build/test/functional/feature_fee_estimation.py --random=3450808900320758527
This PR fixes the test by adding the custom higher minrelaytxfee
value to self.fees_per_kb
, but only when checking smart fee estimates.
It also improves the subtest name and adds more robust test along with clearer comments.