Support fee estimation for fees lower than 1 sat/byte

This commit is contained in:
Steven Roose 2020-03-25 14:37:15 +00:00
parent 3c029f42bd
commit 6939a7248f
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87
2 changed files with 8 additions and 3 deletions

View file

@ -901,7 +901,9 @@ bool CBlockPolicyEstimator::Write(CAutoFile& fileout) const
{
try {
LOCK(m_cs_fee_estimator);
fileout << 149900; // version required to read: 0.14.99 or later
//ELEMENTS: We upped this from 0.14.99 in upstream because
// we changed the bucket sizes.
fileout << 180107; // version required to read: 0.18.1.7
fileout << CLIENT_VERSION; // version that wrote the file
fileout << nBestSeenHeight;
if (BlockSpan() > HistoricalBlockSpan()/2) {
@ -938,6 +940,9 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein)
if (nVersionRequired < 149900) {
LogPrintf("%s: incompatible old fee estimation data (non-fatal). Version: %d\n", __func__, nVersionRequired);
} else if (nVersionThatWrote < 180107) {
//ELEMENTS: we changed the buckets in 0.18.1.7
LogPrintf("%s: incompatible old fee estimation data (non-fatal). Version: %d\n", __func__, nVersionThatWrote);
} else { // New format introduced in 149900
unsigned int nFileHistoricalFirst, nFileHistoricalBest;
filein >> nFileHistoricalFirst >> nFileHistoricalBest;

View file

@ -174,8 +174,8 @@ private:
* invalidates old estimates files. So leave it at 1000 unless it becomes
* necessary to lower it, and then lower it substantially.
*/
static constexpr double MIN_BUCKET_FEERATE = 1000;
static constexpr double MAX_BUCKET_FEERATE = 1e7;
static constexpr double MIN_BUCKET_FEERATE = 100;
static constexpr double MAX_BUCKET_FEERATE = 1e6;
/** Spacing of FeeRate buckets
* We have to lump transactions into buckets based on feerate, but we want to be able