Merge #17328: GuessVerificationProgress: cap the ratio to 1
2f5f7d6b13
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: ACK2f5f7d6b13
promag: ACK2f5f7d6b13
. Tree-SHA512: fa3aca12acab9c14dab3b2cc94351082f548ea6e6c588987cd86e928a00feb023e8112433658a0e85084e294bfd940eaafa33fb46c4add94146a0901bc1c4f80
This commit is contained in:
commit
63fac52f31
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue