1

Are the data for smart fee estimation (in bitcoin core with version 0.15.0 or larger) saved?

Where is it saved, what is the format?

Can they be re-used on a different node - so the estimates are accurate, even when the node is just started? If the file (or files) is moved from node to a different node (that has a different chain state), will the fee estimates still be accurate?

1 Answer 1

5

In the bitcoin data directory, there is a file called fee_estimates.dat. This file is only written when bitcoind or bitcoin-qt exits so it is not up to date until that point. After that you could copy it and use it on another node to start with up to date estimates.

There is some trickery if the nodes are at different chain heights, but it should mostly do the right thing. It tracks the block height that the estimates were written as of and the new node won't affect the estimates until it's active chain has advanced beyond the latest recorded block in the old file. Also if the chain in the new node is past the last recorded block in the file, then the estimates are decayed under the assumption that the data is no longer as meaningful.

In general if you start from scratch, you should only need to wait for about twice as many blocks as the target you would like an estimate for before you are able to get a somewhat reasonable answer.

1
  • 1
    This is some very useful information @morcos. I was wondering what happens if a node hsa been running for a very long time and then it's stopped and restarted one month later. Are the estimates from one month ago decayed so much they are negligible or they still bear a heavy wait because it was "just before it restarted"? Also, is there a way to deserialize the information in fee_estimates.dat? I would like to take a look at the information stored in there.
    – Pedro
    Feb 28, 2019 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.