Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Lines | void Shutdown(NodeContext &node) { | ||||
// using the other before destroying them. | // using the other before destroying them. | ||||
if (node.peerman) { | if (node.peerman) { | ||||
UnregisterValidationInterface(node.peerman.get()); | UnregisterValidationInterface(node.peerman.get()); | ||||
} | } | ||||
if (node.connman) { | if (node.connman) { | ||||
node.connman->Stop(); | node.connman->Stop(); | ||||
} | } | ||||
#if ENABLE_CHRONIK | |||||
chronik::Stop(); | |||||
#endif | |||||
StopTorControl(); | StopTorControl(); | ||||
// After everything has been shut down, but before things get flushed, stop | // After everything has been shut down, but before things get flushed, stop | ||||
// the CScheduler/checkqueue, scheduler and load block thread. | // the CScheduler/checkqueue, scheduler and load block thread. | ||||
if (node.scheduler) { | if (node.scheduler) { | ||||
node.scheduler->stop(); | node.scheduler->stop(); | ||||
} | } | ||||
if (node.chainman && node.chainman->m_load_block.joinable()) { | if (node.chainman && node.chainman->m_load_block.joinable()) { | ||||
Show All 26 Lines | if (node.chainman) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// After there are no more peers/RPC left to give us new data which may | // After there are no more peers/RPC left to give us new data which may | ||||
// generate CValidationInterface callbacks, flush them... | // generate CValidationInterface callbacks, flush them... | ||||
GetMainSignals().FlushBackgroundCallbacks(); | GetMainSignals().FlushBackgroundCallbacks(); | ||||
#if ENABLE_CHRONIK | |||||
chronik::Stop(); | |||||
#endif | |||||
// Stop and delete all indexes only after flushing background callbacks. | // Stop and delete all indexes only after flushing background callbacks. | ||||
if (g_txindex) { | if (g_txindex) { | ||||
g_txindex->Stop(); | g_txindex->Stop(); | ||||
g_txindex.reset(); | g_txindex.reset(); | ||||
} | } | ||||
if (g_coin_stats_index) { | if (g_coin_stats_index) { | ||||
g_coin_stats_index->Stop(); | g_coin_stats_index->Stop(); | ||||
g_coin_stats_index.reset(); | g_coin_stats_index.reset(); | ||||
▲ Show 20 Lines • Show All 2,691 Lines • Show Last 20 Lines |