Fixes #27555
The issue arises when an old fee_estimates.dat
file is sometimes read during initialization.
Or after an unclean shutdown, the latest fee estimates are not flushed to fee_estimates.dat
.
If the fee estimates in the old file are old, they can cause transactions to become stuck in the mempool.
This PR ensures that nodes do not use stale estimates from the old file during initialization. If fee_estimates.dat
has not been updated for 60 hours or more, it is considered stale and will not be read during initialization. To avoid
having old estimates, the fee_estimates.dat
file will be flushed periodically every hour. As mentioned #27555
“The immediate improvement would be to store fee estimates to disk once an hour or so to reduce the chance of having an old file. From there, this case could probably be detected, and refuse to serve estimates until we sync.”
In addition, I will follow-up PR to persist the mempoolminfee
across restarts.