@@ -168,7 +168,7 @@ class TxConfirmStats
168
168
* Read saved state of estimation data from a file and replace all internal data structures and
169
169
* variables with this state.
170
170
*/
171
- void Read (AutoFile& filein, int nFileVersion, size_t numBuckets);
171
+ void Read (AutoFile& filein, size_t numBuckets);
172
172
};
173
173
174
174
@@ -414,7 +414,7 @@ void TxConfirmStats::Write(AutoFile& fileout) const
414
414
fileout << Using<VectorFormatter<VectorFormatter<EncodedDoubleFormatter>>>(failAvg);
415
415
}
416
416
417
- void TxConfirmStats::Read (AutoFile& filein, int nFileVersion, size_t numBuckets)
417
+ void TxConfirmStats::Read (AutoFile& filein, size_t numBuckets)
418
418
{
419
419
// Read data file and do some very basic sanity checking
420
420
// buckets and bucketMap are not updated yet, so don't access them
@@ -962,7 +962,7 @@ bool CBlockPolicyEstimator::Write(AutoFile& fileout) const
962
962
try {
963
963
LOCK (m_cs_fee_estimator);
964
964
fileout << 149900 ; // version required to read: 0.14.99 or later
965
- fileout << CLIENT_VERSION ; // version that wrote the file
965
+ fileout << int { 0 } ; // Unused dummy field. Written files may contain any value in [0, 289900]
966
966
fileout << nBestSeenHeight;
967
967
if (BlockSpan () > HistoricalBlockSpan ()/2 ) {
968
968
fileout << firstRecordedHeight << nBestSeenHeight;
@@ -986,8 +986,8 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein)
986
986
{
987
987
try {
988
988
LOCK (m_cs_fee_estimator);
989
- int nVersionRequired, nVersionThatWrote ;
990
- filein >> nVersionRequired >> nVersionThatWrote ;
989
+ int nVersionRequired, dummy ;
990
+ filein >> nVersionRequired >> dummy ;
991
991
if (nVersionRequired > CLIENT_VERSION) {
992
992
throw std::runtime_error (strprintf (" up-version (%d) fee estimate file" , nVersionRequired));
993
993
}
@@ -1015,9 +1015,9 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein)
1015
1015
std::unique_ptr<TxConfirmStats> fileFeeStats (new TxConfirmStats (buckets, bucketMap, MED_BLOCK_PERIODS, MED_DECAY, MED_SCALE));
1016
1016
std::unique_ptr<TxConfirmStats> fileShortStats (new TxConfirmStats (buckets, bucketMap, SHORT_BLOCK_PERIODS, SHORT_DECAY, SHORT_SCALE));
1017
1017
std::unique_ptr<TxConfirmStats> fileLongStats (new TxConfirmStats (buckets, bucketMap, LONG_BLOCK_PERIODS, LONG_DECAY, LONG_SCALE));
1018
- fileFeeStats->Read (filein, nVersionThatWrote, numBuckets);
1019
- fileShortStats->Read (filein, nVersionThatWrote, numBuckets);
1020
- fileLongStats->Read (filein, nVersionThatWrote, numBuckets);
1018
+ fileFeeStats->Read (filein, numBuckets);
1019
+ fileShortStats->Read (filein, numBuckets);
1020
+ fileLongStats->Read (filein, numBuckets);
1021
1021
1022
1022
// Fee estimates file parsed correctly
1023
1023
// Copy buckets from file and refresh our bucketmap
0 commit comments