Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 2,032 Lines • ▼ Show 20 Lines | void CChainState::PruneAndFlush() { | ||||
const CChainParams &chainparams = Params(); | const CChainParams &chainparams = Params(); | ||||
if (!this->FlushStateToDisk(chainparams, state, FlushStateMode::NONE)) { | if (!this->FlushStateToDisk(chainparams, state, FlushStateMode::NONE)) { | ||||
LogPrintf("%s: failed to flush state (%s)\n", __func__, | LogPrintf("%s: failed to flush state (%s)\n", __func__, | ||||
FormatStateMessage(state)); | FormatStateMessage(state)); | ||||
} | } | ||||
} | } | ||||
/** Check warning conditions and do some notifications on new chain tip set. */ | /** Check warning conditions and do some notifications on new chain tip set. */ | ||||
static void UpdateTip(const CChainParams ¶ms, CBlockIndex *pindexNew) { | static void UpdateTip(const CChainParams ¶ms, CBlockIndex *pindexNew) | ||||
EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { | |||||
// New best block | // New best block | ||||
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(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 3,716 Lines • Show Last 20 Lines |