Skip to content

Commit fa1c5cc

Browse files
author
MarcoFalke
committed
fees: Log non-fatal errors as [warning], instead of info-level
Also, remove not needed and possibly redundant function name and class names from the log string. Also, minimally reword the log messages. Also, remove redundant trailing newlines from log messages, while touching.
1 parent ddddbac commit fa1c5cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/policy/fees.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ bool CBlockPolicyEstimator::Write(AutoFile& fileout) const
979979
longStats->Write(fileout);
980980
}
981981
catch (const std::exception&) {
982-
LogPrintf("CBlockPolicyEstimator::Write(): unable to write policy estimator data (non-fatal)\n");
982+
LogWarning("Unable to write policy estimator data (non-fatal)");
983983
return false;
984984
}
985985
return true;
@@ -992,7 +992,7 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein)
992992
int nVersionRequired, dummy;
993993
filein >> nVersionRequired >> dummy;
994994
if (nVersionRequired > CURRENT_FEES_FILE_VERSION) {
995-
throw std::runtime_error(strprintf("up-version (%d) fee estimate file", nVersionRequired));
995+
throw std::runtime_error{strprintf("File version (%d) too high to be read.", nVersionRequired)};
996996
}
997997

998998
// Read fee estimates file into temporary variables so existing data
@@ -1001,7 +1001,7 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein)
10011001
filein >> nFileBestSeenHeight;
10021002

10031003
if (nVersionRequired < CURRENT_FEES_FILE_VERSION) {
1004-
LogPrintf("%s: incompatible old fee estimation data (non-fatal). Version: %d\n", __func__, nVersionRequired);
1004+
LogWarning("Incompatible old fee estimation data (non-fatal). Version: %d", nVersionRequired);
10051005
} else { // nVersionRequired == CURRENT_FEES_FILE_VERSION
10061006
unsigned int nFileHistoricalFirst, nFileHistoricalBest;
10071007
filein >> nFileHistoricalFirst >> nFileHistoricalBest;
@@ -1041,7 +1041,7 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein)
10411041
}
10421042
}
10431043
catch (const std::exception& e) {
1044-
LogPrintf("CBlockPolicyEstimator::Read(): unable to read policy estimator data (non-fatal): %s\n",e.what());
1044+
LogWarning("Unable to read policy estimator data (non-fatal): %s", e.what());
10451045
return false;
10461046
}
10471047
return true;

0 commit comments

Comments
 (0)