aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordarosior <darosior@protonmail.com>2019-10-31 15:40:14 +0100
committerdarosior <darosior@protonmail.com>2019-10-31 17:31:43 +0100
commit2f5f7d6b135e4eab368bbafd9e6e979aa72398de (patch)
tree8a52d7bfeb450958e8b99eccf53256d0be61550a /src
parentfeb1a8c03aff0d37730d80eee7a05cc7e4729850 (diff)
GuessVerificationProgress: cap the ratio to 1
The getblockchaininfo RPC call could sometime return a 'validationprogress' > 1, but this is absurd.
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index ca6d2176b3..dd99be3bca 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -5066,7 +5066,7 @@ double GuessVerificationProgress(const ChainTxData& data, const CBlockIndex *pin
fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate;
}
- return pindex->nChainTx / fTxTotal;
+ return std::min<double>(pindex->nChainTx / fTxTotal, 1.0);
}
class CMainCleanup