Skip to content

Commit 2f5f7d6

Browse files
committed
GuessVerificationProgress: cap the ratio to 1
The getblockchaininfo RPC call could sometime return a 'validationprogress' > 1, but this is absurd.
1 parent feb1a8c commit 2f5f7d6

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
@@ -5066,7 +5066,7 @@ double GuessVerificationProgress(const ChainTxData& data, const CBlockIndex *pin
50665066
fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate;
50675067
}
50685068

5069-
return pindex->nChainTx / fTxTotal;
5069+
return std::min<double>(pindex->nChainTx / fTxTotal, 1.0);
50705070
}
50715071

50725072
class CMainCleanup

0 commit comments

Comments
 (0)