mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 14:37:42 -03:00
fees: Pin "version that wrote" to 0
The field is unused and there is no need to tie it to CLIENT_VERSION and increase it, if the format does not change.
This commit is contained in:
parent
5fb9455063
commit
fa5126adcb
1 changed files with 8 additions and 8 deletions
|
@ -168,7 +168,7 @@ public:
|
||||||
* Read saved state of estimation data from a file and replace all internal data structures and
|
* Read saved state of estimation data from a file and replace all internal data structures and
|
||||||
* variables with this state.
|
* variables with this state.
|
||||||
*/
|
*/
|
||||||
void Read(AutoFile& filein, int nFileVersion, size_t numBuckets);
|
void Read(AutoFile& filein, size_t numBuckets);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -414,7 +414,7 @@ void TxConfirmStats::Write(AutoFile& fileout) const
|
||||||
fileout << Using<VectorFormatter<VectorFormatter<EncodedDoubleFormatter>>>(failAvg);
|
fileout << Using<VectorFormatter<VectorFormatter<EncodedDoubleFormatter>>>(failAvg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TxConfirmStats::Read(AutoFile& filein, int nFileVersion, size_t numBuckets)
|
void TxConfirmStats::Read(AutoFile& filein, size_t numBuckets)
|
||||||
{
|
{
|
||||||
// Read data file and do some very basic sanity checking
|
// Read data file and do some very basic sanity checking
|
||||||
// buckets and bucketMap are not updated yet, so don't access them
|
// buckets and bucketMap are not updated yet, so don't access them
|
||||||
|
@ -962,7 +962,7 @@ bool CBlockPolicyEstimator::Write(AutoFile& fileout) const
|
||||||
try {
|
try {
|
||||||
LOCK(m_cs_fee_estimator);
|
LOCK(m_cs_fee_estimator);
|
||||||
fileout << 149900; // version required to read: 0.14.99 or later
|
fileout << 149900; // version required to read: 0.14.99 or later
|
||||||
fileout << CLIENT_VERSION; // version that wrote the file
|
fileout << int{0}; // Unused dummy field. Written files may contain any value in [0, 289900]
|
||||||
fileout << nBestSeenHeight;
|
fileout << nBestSeenHeight;
|
||||||
if (BlockSpan() > HistoricalBlockSpan()/2) {
|
if (BlockSpan() > HistoricalBlockSpan()/2) {
|
||||||
fileout << firstRecordedHeight << nBestSeenHeight;
|
fileout << firstRecordedHeight << nBestSeenHeight;
|
||||||
|
@ -986,8 +986,8 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
LOCK(m_cs_fee_estimator);
|
LOCK(m_cs_fee_estimator);
|
||||||
int nVersionRequired, nVersionThatWrote;
|
int nVersionRequired, dummy;
|
||||||
filein >> nVersionRequired >> nVersionThatWrote;
|
filein >> nVersionRequired >> dummy;
|
||||||
if (nVersionRequired > CLIENT_VERSION) {
|
if (nVersionRequired > CLIENT_VERSION) {
|
||||||
throw std::runtime_error(strprintf("up-version (%d) fee estimate file", nVersionRequired));
|
throw std::runtime_error(strprintf("up-version (%d) fee estimate file", nVersionRequired));
|
||||||
}
|
}
|
||||||
|
@ -1015,9 +1015,9 @@ bool CBlockPolicyEstimator::Read(AutoFile& filein)
|
||||||
std::unique_ptr<TxConfirmStats> fileFeeStats(new TxConfirmStats(buckets, bucketMap, MED_BLOCK_PERIODS, MED_DECAY, MED_SCALE));
|
std::unique_ptr<TxConfirmStats> fileFeeStats(new TxConfirmStats(buckets, bucketMap, MED_BLOCK_PERIODS, MED_DECAY, MED_SCALE));
|
||||||
std::unique_ptr<TxConfirmStats> fileShortStats(new TxConfirmStats(buckets, bucketMap, SHORT_BLOCK_PERIODS, SHORT_DECAY, SHORT_SCALE));
|
std::unique_ptr<TxConfirmStats> fileShortStats(new TxConfirmStats(buckets, bucketMap, SHORT_BLOCK_PERIODS, SHORT_DECAY, SHORT_SCALE));
|
||||||
std::unique_ptr<TxConfirmStats> fileLongStats(new TxConfirmStats(buckets, bucketMap, LONG_BLOCK_PERIODS, LONG_DECAY, LONG_SCALE));
|
std::unique_ptr<TxConfirmStats> fileLongStats(new TxConfirmStats(buckets, bucketMap, LONG_BLOCK_PERIODS, LONG_DECAY, LONG_SCALE));
|
||||||
fileFeeStats->Read(filein, nVersionThatWrote, numBuckets);
|
fileFeeStats->Read(filein, numBuckets);
|
||||||
fileShortStats->Read(filein, nVersionThatWrote, numBuckets);
|
fileShortStats->Read(filein, numBuckets);
|
||||||
fileLongStats->Read(filein, nVersionThatWrote, numBuckets);
|
fileLongStats->Read(filein, numBuckets);
|
||||||
|
|
||||||
// Fee estimates file parsed correctly
|
// Fee estimates file parsed correctly
|
||||||
// Copy buckets from file and refresh our bucketmap
|
// Copy buckets from file and refresh our bucketmap
|
||||||
|
|
Loading…
Add table
Reference in a new issue