Skip to content

Commit fa0d835

Browse files
author
MarcoFalke
committed
log: Clarify that failure to read fee_estimates.dat is non-fatal
An uppercase "ERROR" in the log might indicate a fatal error. Though, all read-failures for fee_estimates.dat are non-fatal, so avoid the "ERROR". Before: ERROR: CBlockPolicyEstimator::Read(): up-version (149900) fee estimate file After: CBlockPolicyEstimator::Read(): unable to read policy estimator data (non-fatal): up-version (149900) fee estimate file
1 parent faefa5d commit fa0d835

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/policy/fees.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,9 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein)
909909
LOCK(m_cs_fee_estimator);
910910
int nVersionRequired, nVersionThatWrote;
911911
filein >> nVersionRequired >> nVersionThatWrote;
912-
if (nVersionRequired > CLIENT_VERSION)
913-
return error("CBlockPolicyEstimator::Read(): up-version (%d) fee estimate file", nVersionRequired);
912+
if (nVersionRequired > CLIENT_VERSION) {
913+
throw std::runtime_error(strprintf("up-version (%d) fee estimate file", nVersionRequired));
914+
}
914915

915916
// Read fee estimates file into temporary variables so existing data
916917
// structures aren't corrupted if there is an exception.
@@ -928,8 +929,9 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein)
928929
std::vector<double> fileBuckets;
929930
filein >> fileBuckets;
930931
size_t numBuckets = fileBuckets.size();
931-
if (numBuckets <= 1 || numBuckets > 1000)
932+
if (numBuckets <= 1 || numBuckets > 1000) {
932933
throw std::runtime_error("Corrupt estimates file. Must have between 2 and 1000 feerate buckets");
934+
}
933935

934936
std::unique_ptr<TxConfirmStats> fileFeeStats(new TxConfirmStats(buckets, bucketMap, MED_BLOCK_PERIODS, MED_DECAY, MED_SCALE));
935937
std::unique_ptr<TxConfirmStats> fileShortStats(new TxConfirmStats(buckets, bucketMap, SHORT_BLOCK_PERIODS, SHORT_DECAY, SHORT_SCALE));

0 commit comments

Comments
 (0)