|
|
@ -855,13 +855,13 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein) |
|
|
|
try { |
|
|
|
try { |
|
|
|
LOCK(cs_feeEstimator); |
|
|
|
LOCK(cs_feeEstimator); |
|
|
|
int nVersionRequired, nVersionThatWrote; |
|
|
|
int nVersionRequired, nVersionThatWrote; |
|
|
|
unsigned int nFileBestSeenHeight, nFileHistoricalFirst, nFileHistoricalBest; |
|
|
|
|
|
|
|
filein >> nVersionRequired >> nVersionThatWrote; |
|
|
|
filein >> nVersionRequired >> nVersionThatWrote; |
|
|
|
if (nVersionRequired > CLIENT_VERSION) |
|
|
|
if (nVersionRequired > CLIENT_VERSION) |
|
|
|
return error("CBlockPolicyEstimator::Read(): up-version (%d) fee estimate file", nVersionRequired); |
|
|
|
return error("CBlockPolicyEstimator::Read(): up-version (%d) fee estimate file", nVersionRequired); |
|
|
|
|
|
|
|
|
|
|
|
// Read fee estimates file into temporary variables so existing data
|
|
|
|
// Read fee estimates file into temporary variables so existing data
|
|
|
|
// structures aren't corrupted if there is an exception.
|
|
|
|
// structures aren't corrupted if there is an exception.
|
|
|
|
|
|
|
|
unsigned int nFileBestSeenHeight; |
|
|
|
filein >> nFileBestSeenHeight; |
|
|
|
filein >> nFileBestSeenHeight; |
|
|
|
|
|
|
|
|
|
|
|
if (nVersionThatWrote < 149900) { |
|
|
|
if (nVersionThatWrote < 149900) { |
|
|
@ -890,6 +890,7 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else { // nVersionThatWrote >= 149900
|
|
|
|
else { // nVersionThatWrote >= 149900
|
|
|
|
|
|
|
|
unsigned int nFileHistoricalFirst, nFileHistoricalBest; |
|
|
|
filein >> nFileHistoricalFirst >> nFileHistoricalBest; |
|
|
|
filein >> nFileHistoricalFirst >> nFileHistoricalBest; |
|
|
|
if (nFileHistoricalFirst > nFileHistoricalBest || nFileHistoricalBest > nFileBestSeenHeight) { |
|
|
|
if (nFileHistoricalFirst > nFileHistoricalBest || nFileHistoricalBest > nFileBestSeenHeight) { |
|
|
|
throw std::runtime_error("Corrupt estimates file. Historical block range for estimates is invalid"); |
|
|
|
throw std::runtime_error("Corrupt estimates file. Historical block range for estimates is invalid"); |
|
|
|