aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-11-18 14:13:26 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-11-18 14:14:03 +0100
commit63fac52f31ea37e5c71a64198c76484bc87dc11d (patch)
tree1a60d7067dcec1bbb941a2264619cfb39018ac44 /src
parent24647a09e710732376bfd202df0f7566861edb4b (diff)
parent2f5f7d6b135e4eab368bbafd9e6e979aa72398de (diff)
downloadbitcoin-63fac52f31ea37e5c71a64198c76484bc87dc11d.tar.xz
Merge #17328: GuessVerificationProgress: cap the ratio to 1
2f5f7d6b135e4eab368bbafd9e6e979aa72398de GuessVerificationProgress: cap the ratio to 1 (darosior) Pull request description: Noticed `getblockchaininfo` would return a `verificationprogress` > 1, especially while generating. This caps the verification progress to `1`. Tried to append a check to functional tests but this would pass even without the patch, so it seems better to not add a superfluous check (but this can easily be reproduced by trying to generate blocks in the background and `watch`ing `getblockchainfo`). ACKs for top commit: laanwj: ACK 2f5f7d6b135e4eab368bbafd9e6e979aa72398de promag: ACK 2f5f7d6b135e4eab368bbafd9e6e979aa72398de. Tree-SHA512: fa3aca12acab9c14dab3b2cc94351082f548ea6e6c588987cd86e928a00feb023e8112433658a0e85084e294bfd940eaafa33fb46c4add94146a0901bc1c4f80
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 cc7687ae05..e744110371 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -5089,7 +5089,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