GuessVerificationProgress: cap the ratio to 1
The getblockchaininfo RPC call could sometime return a 'validationprogress' > 1, but this is absurd.
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -5066,7 +5066,7 @@ double GuessVerificationProgress(const ChainTxData& data, const CBlockIndex *pin
|
|||||||
fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate;
|
fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pindex->nChainTx / fTxTotal;
|
return std::min<double>(pindex->nChainTx / fTxTotal, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CMainCleanup
|
class CMainCleanup
|
||||||
|
|||||||
Reference in new issue
Block a user