Skip to content

Commit 63fac52

Browse files
committed
Merge #17328: GuessVerificationProgress: cap the ratio to 1
2f5f7d6 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 2f5f7d6 promag: ACK 2f5f7d6. Tree-SHA512: fa3aca12acab9c14dab3b2cc94351082f548ea6e6c588987cd86e928a00feb023e8112433658a0e85084e294bfd940eaafa33fb46c4add94146a0901bc1c4f80
2 parents 24647a0 + 2f5f7d6 commit 63fac52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5089,7 +5089,7 @@ double GuessVerificationProgress(const ChainTxData& data, const CBlockIndex *pin
50895089
fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate;
50905090
}
50915091

5092-
return pindex->nChainTx / fTxTotal;
5092+
return std::min<double>(pindex->nChainTx / fTxTotal, 1.0);
50935093
}
50945094

50955095
class CMainCleanup

0 commit comments

Comments
 (0)