Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 5,419 Lines • ▼ Show 20 Lines | try { | ||||
(mid - start) * 0.000001, (last - mid) * 0.000001); | (mid - start) * 0.000001, (last - mid) * 0.000001); | ||||
} catch (const std::exception &e) { | } catch (const std::exception &e) { | ||||
LogPrintf("Failed to dump mempool: %s. Continuing anyway.\n", e.what()); | LogPrintf("Failed to dump mempool: %s. Continuing anyway.\n", e.what()); | ||||
} | } | ||||
} | } | ||||
//! Guess how far we are in the verification process at the given block index | //! Guess how far we are in the verification process at the given block index | ||||
double GuessVerificationProgress(const ChainTxData &data, CBlockIndex *pindex) { | double GuessVerificationProgress(const ChainTxData &data, CBlockIndex *pindex) { | ||||
if (pindex == nullptr) return 0.0; | if (pindex == nullptr) { | ||||
return 0.0; | |||||
} | |||||
int64_t nNow = time(nullptr); | int64_t nNow = time(nullptr); | ||||
double fTxTotal; | double fTxTotal; | ||||
if (pindex->nChainTx <= data.nTxCount) { | if (pindex->nChainTx <= data.nTxCount) { | ||||
fTxTotal = data.nTxCount + (nNow - data.nTime) * data.dTxRate; | fTxTotal = data.nTxCount + (nNow - data.nTime) * data.dTxRate; | ||||
} else { | } else { | ||||
fTxTotal = | fTxTotal = | ||||
pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate; | pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate; | ||||
} | } | ||||
return pindex->nChainTx / fTxTotal; | return pindex->nChainTx / fTxTotal; | ||||
Show All 13 Lines |