Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 1,047 Lines • ▼ Show 20 Lines | void CChainState::InvalidChainFound(CBlockIndex *pindexNew) { | ||||
} | } | ||||
// If the invalid chain found is supposed to be finalized, we need to move | // If the invalid chain found is supposed to be finalized, we need to move | ||||
// back the finalization point. | // back the finalization point. | ||||
if (IsBlockFinalized(pindexNew)) { | if (IsBlockFinalized(pindexNew)) { | ||||
m_finalizedBlockIndex = pindexNew->pprev; | m_finalizedBlockIndex = pindexNew->pprev; | ||||
} | } | ||||
LogPrintf("%s: invalid block=%s height=%d log2_work=%.8g date=%s\n", | LogPrintf("%s: invalid block=%s height=%d log2_work=%f date=%s\n", | ||||
__func__, pindexNew->GetBlockHash().ToString(), | __func__, pindexNew->GetBlockHash().ToString(), | ||||
pindexNew->nHeight, | pindexNew->nHeight, | ||||
log(pindexNew->nChainWork.getdouble()) / log(2.0), | log(pindexNew->nChainWork.getdouble()) / log(2.0), | ||||
FormatISO8601DateTime(pindexNew->GetBlockTime())); | FormatISO8601DateTime(pindexNew->GetBlockTime())); | ||||
CBlockIndex *tip = ::ChainActive().Tip(); | CBlockIndex *tip = ::ChainActive().Tip(); | ||||
assert(tip); | assert(tip); | ||||
LogPrintf("%s: current best=%s height=%d log2_work=%.8g date=%s\n", | LogPrintf("%s: current best=%s height=%d log2_work=%f date=%s\n", | ||||
__func__, tip->GetBlockHash().ToString(), | __func__, tip->GetBlockHash().ToString(), | ||||
::ChainActive().Height(), | ::ChainActive().Height(), | ||||
log(tip->nChainWork.getdouble()) / log(2.0), | log(tip->nChainWork.getdouble()) / log(2.0), | ||||
FormatISO8601DateTime(tip->GetBlockTime())); | FormatISO8601DateTime(tip->GetBlockTime())); | ||||
} | } | ||||
// Same as InvalidChainFound, above, except not called directly from | // Same as InvalidChainFound, above, except not called directly from | ||||
// InvalidateBlock, which does its own setBlockIndexCandidates management. | // InvalidateBlock, which does its own setBlockIndexCandidates management. | ||||
▲ Show 20 Lines • Show All 1,225 Lines • ▼ Show 20 Lines | static void UpdateTip(const CChainParams ¶ms, CBlockIndex *pindexNew) | ||||
g_mempool.AddTransactionsUpdated(1); | g_mempool.AddTransactionsUpdated(1); | ||||
{ | { | ||||
LOCK(g_best_block_mutex); | LOCK(g_best_block_mutex); | ||||
g_best_block = pindexNew->GetBlockHash(); | g_best_block = pindexNew->GetBlockHash(); | ||||
g_best_block_cv.notify_all(); | g_best_block_cv.notify_all(); | ||||
} | } | ||||
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%ld " | LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%f tx=%ld " | ||||
"date='%s' progress=%f cache=%.1fMiB(%utxo)\n", | "date='%s' progress=%f cache=%.1fMiB(%utxo)\n", | ||||
__func__, pindexNew->GetBlockHash().ToString(), | __func__, pindexNew->GetBlockHash().ToString(), | ||||
pindexNew->nHeight, pindexNew->nVersion, | pindexNew->nHeight, pindexNew->nVersion, | ||||
log(pindexNew->nChainWork.getdouble()) / log(2.0), | log(pindexNew->nChainWork.getdouble()) / log(2.0), | ||||
pindexNew->GetChainTxCount(), | pindexNew->GetChainTxCount(), | ||||
FormatISO8601DateTime(pindexNew->GetBlockTime()), | FormatISO8601DateTime(pindexNew->GetBlockTime()), | ||||
GuessVerificationProgress(params.TxData(), pindexNew), | GuessVerificationProgress(params.TxData(), pindexNew), | ||||
::ChainstateActive().CoinsTip().DynamicMemoryUsage() * | ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * | ||||
▲ Show 20 Lines • Show All 3,845 Lines • Show Last 20 Lines |