Skip to content

Commit 62e7c04

Browse files
committed
Remove dead feeest-file read code for old versions
0.15.0 introduced a new feeest file format, and support for parsing old versions was never fully added. We now simply fail to read the old format, so remove the dead partial-implementation.
1 parent cdd6bbf commit 62e7c04

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

src/policy/fees.cpp

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,13 @@ void TxConfirmStats::Read(CAutoFile& filein, int nFileVersion, size_t numBuckets
411411
size_t maxConfirms, maxPeriods;
412412

413413
// The current version will store the decay with each individual TxConfirmStats and also keep a scale factor
414-
if (nFileVersion >= 149900) {
415-
filein >> decay;
416-
if (decay <= 0 || decay >= 1) {
417-
throw std::runtime_error("Corrupt estimates file. Decay must be between 0 and 1 (non-inclusive)");
418-
}
419-
filein >> scale;
420-
if (scale == 0) {
421-
throw std::runtime_error("Corrupt estimates file. Scale must be non-zero");
422-
}
414+
filein >> decay;
415+
if (decay <= 0 || decay >= 1) {
416+
throw std::runtime_error("Corrupt estimates file. Decay must be between 0 and 1 (non-inclusive)");
417+
}
418+
filein >> scale;
419+
if (scale == 0) {
420+
throw std::runtime_error("Corrupt estimates file. Scale must be non-zero");
423421
}
424422

425423
filein >> avg;
@@ -443,20 +441,13 @@ void TxConfirmStats::Read(CAutoFile& filein, int nFileVersion, size_t numBuckets
443441
}
444442
}
445443

446-
if (nFileVersion >= 149900) {
447-
filein >> failAvg;
448-
if (maxPeriods != failAvg.size()) {
449-
throw std::runtime_error("Corrupt estimates file. Mismatch in confirms tracked for failures");
450-
}
451-
for (unsigned int i = 0; i < maxPeriods; i++) {
452-
if (failAvg[i].size() != numBuckets) {
453-
throw std::runtime_error("Corrupt estimates file. Mismatch in one of failure average bucket counts");
454-
}
455-
}
456-
} else {
457-
failAvg.resize(confAvg.size());
458-
for (unsigned int i = 0; i < failAvg.size(); i++) {
459-
failAvg[i].resize(numBuckets);
444+
filein >> failAvg;
445+
if (maxPeriods != failAvg.size()) {
446+
throw std::runtime_error("Corrupt estimates file. Mismatch in confirms tracked for failures");
447+
}
448+
for (unsigned int i = 0; i < maxPeriods; i++) {
449+
if (failAvg[i].size() != numBuckets) {
450+
throw std::runtime_error("Corrupt estimates file. Mismatch in one of failure average bucket counts");
460451
}
461452
}
462453

@@ -563,7 +554,7 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo
563554
if (mapMemPoolTxs.count(hash)) {
564555
LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy error mempool tx %s already being tracked\n",
565556
hash.ToString().c_str());
566-
return;
557+
return;
567558
}
568559

569560
if (txHeight != nBestSeenHeight) {

0 commit comments

Comments
 (0)