Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | |||||
#include <util/translation.h> | #include <util/translation.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <validationinterface.h> | #include <validationinterface.h> | ||||
#include <walletinitinterface.h> | #include <walletinitinterface.h> | ||||
#include <boost/algorithm/string/replace.hpp> | #include <boost/algorithm/string/replace.hpp> | ||||
#include <boost/signals2/signal.hpp> | #include <boost/signals2/signal.hpp> | ||||
#if ENABLE_CHRONIK | |||||
#include <chronik-cpp/chronik.h> | |||||
#endif | |||||
#if ENABLE_ZMQ | #if ENABLE_ZMQ | ||||
#include <zmq/zmqabstractnotifier.h> | #include <zmq/zmqabstractnotifier.h> | ||||
#include <zmq/zmqnotificationinterface.h> | #include <zmq/zmqnotificationinterface.h> | ||||
#include <zmq/zmqrpc.h> | #include <zmq/zmqrpc.h> | ||||
#endif | #endif | ||||
#ifndef WIN32 | #ifndef WIN32 | ||||
#include <attributes.h> | #include <attributes.h> | ||||
▲ Show 20 Lines • Show All 138 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 20 Lines • Show All 2,667 Lines • ▼ Show 20 Lines | for (const auto &filter_type : g_enabled_filter_types) { | ||||
GetBlockFilterIndex(filter_type)->Start(chainman.ActiveChainstate()); | GetBlockFilterIndex(filter_type)->Start(chainman.ActiveChainstate()); | ||||
} | } | ||||
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX)) { | if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX)) { | ||||
g_coin_stats_index = std::make_unique<CoinStatsIndex>( | g_coin_stats_index = std::make_unique<CoinStatsIndex>( | ||||
/* cache size */ 0, false, fReindex); | /* cache size */ 0, false, fReindex); | ||||
g_coin_stats_index->Start(chainman.ActiveChainstate()); | g_coin_stats_index->Start(chainman.ActiveChainstate()); | ||||
} | } | ||||
#if ENABLE_CHRONIK | |||||
chronik::Start(config, node); | |||||
#endif | |||||
// Step 9: load wallet | // Step 9: load wallet | ||||
for (const auto &client : node.chain_clients) { | for (const auto &client : node.chain_clients) { | ||||
if (!client->load()) { | if (!client->load()) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
// Step 10: data directory maintenance | // Step 10: data directory maintenance | ||||
▲ Show 20 Lines • Show All 269 Lines • Show Last 20 Lines |