From 90593ed92cfd5d49900a6fb6c2c10a482ab9fdbb Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 4 Jun 2017 22:45:22 +0200 Subject: Limit variable scope --- src/policy/fees.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/policy/fees.cpp') diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 66083fe1ee..d22b4e06e4 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -855,13 +855,13 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein) try { LOCK(cs_feeEstimator); int nVersionRequired, nVersionThatWrote; - unsigned int nFileBestSeenHeight, nFileHistoricalFirst, nFileHistoricalBest; filein >> nVersionRequired >> nVersionThatWrote; if (nVersionRequired > CLIENT_VERSION) return error("CBlockPolicyEstimator::Read(): up-version (%d) fee estimate file", nVersionRequired); // Read fee estimates file into temporary variables so existing data // structures aren't corrupted if there is an exception. + unsigned int nFileBestSeenHeight; filein >> nFileBestSeenHeight; if (nVersionThatWrote < 149900) { @@ -890,6 +890,7 @@ bool CBlockPolicyEstimator::Read(CAutoFile& filein) } } else { // nVersionThatWrote >= 149900 + unsigned int nFileHistoricalFirst, nFileHistoricalBest; filein >> nFileHistoricalFirst >> nFileHistoricalBest; if (nFileHistoricalFirst > nFileHistoricalBest || nFileHistoricalBest > nFileBestSeenHeight) { throw std::runtime_error("Corrupt estimates file. Historical block range for estimates is invalid"); -- cgit v1.2.3