Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | for (const auto &client : node.chain_clients) { | ||||
client->flush(); | client->flush(); | ||||
} | } | ||||
StopMapPort(); | StopMapPort(); | ||||
// Because avalanche and the network depend on each other, it is important | // Because avalanche and the network depend on each other, it is important | ||||
// to shut them down in this order: | // to shut them down in this order: | ||||
// 1. Stop avalanche event loop. | // 1. Stop avalanche event loop. | ||||
// 2. Shutdown network processing. | // 2. Shutdown network processing. | ||||
// 3. Destroy AvalancheProcessor. | // 3. Destroy avalanche::Processor. | ||||
// 4. Destroy CConnman | // 4. Destroy CConnman | ||||
if (g_avalanche) { | if (g_avalanche) { | ||||
g_avalanche->stopEventLoop(); | g_avalanche->stopEventLoop(); | ||||
} | } | ||||
// Because these depend on each-other, we make sure that neither can be | // Because these depend on each-other, we make sure that neither can be | ||||
// using the other before destroying them. | // using the other before destroying them. | ||||
if (node.peer_logic) { | if (node.peer_logic) { | ||||
▲ Show 20 Lines • Show All 2,114 Lines • ▼ Show 20 Lines | #endif | ||||
if (gArgs.IsArgSet("-maxuploadtarget")) { | if (gArgs.IsArgSet("-maxuploadtarget")) { | ||||
nMaxOutboundLimit = | nMaxOutboundLimit = | ||||
gArgs.GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET) * 1024 * | gArgs.GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET) * 1024 * | ||||
1024; | 1024; | ||||
} | } | ||||
// Step 6.5 (I guess ?): Initialize Avalanche. | // Step 6.5 (I guess ?): Initialize Avalanche. | ||||
g_avalanche = std::make_unique<AvalancheProcessor>(node.connman.get()); | g_avalanche = std::make_unique<avalanche::Processor>(node.connman.get()); | ||||
// Step 7: load block chain | // Step 7: load block chain | ||||
fReindex = gArgs.GetBoolArg("-reindex", false); | fReindex = gArgs.GetBoolArg("-reindex", false); | ||||
bool fReindexChainState = gArgs.GetBoolArg("-reindex-chainstate", false); | bool fReindexChainState = gArgs.GetBoolArg("-reindex-chainstate", false); | ||||
// cache size calculations | // cache size calculations | ||||
int64_t nTotalCache = (gArgs.GetArg("-dbcache", nDefaultDbCache) << 20); | int64_t nTotalCache = (gArgs.GetArg("-dbcache", nDefaultDbCache) << 20); | ||||
▲ Show 20 Lines • Show All 461 Lines • Show Last 20 Lines |