Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 2,239 Lines • ▼ Show 20 Lines | // Wait for genesis block to be processed | ||||
while (!fHaveGenesis && !ShutdownRequested()) { | while (!fHaveGenesis && !ShutdownRequested()) { | ||||
condvar_GenesisWait.wait_for(lock, std::chrono::milliseconds(500)); | condvar_GenesisWait.wait_for(lock, std::chrono::milliseconds(500)); | ||||
} | } | ||||
uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait); | uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait); | ||||
} | } | ||||
// Step 11: start node | // Step 11: start node | ||||
int chain_active_height; | |||||
//// debug print | //// debug print | ||||
{ | |||||
LOCK(cs_main); | |||||
LogPrintf("mapBlockIndex.size() = %u\n", mapBlockIndex.size()); | LogPrintf("mapBlockIndex.size() = %u\n", mapBlockIndex.size()); | ||||
LogPrintf("nBestHeight = %d\n", chainActive.Height()); | chain_active_height = chainActive.Height(); | ||||
} | |||||
LogPrintf("nBestHeight = %d\n", chain_active_height); | |||||
if (gArgs.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) { | if (gArgs.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) { | ||||
StartTorControl(); | StartTorControl(); | ||||
} | } | ||||
Discover(); | Discover(); | ||||
// Map ports with UPnP | // Map ports with UPnP | ||||
if (gArgs.GetBoolArg("-upnp", DEFAULT_UPNP)) { | if (gArgs.GetBoolArg("-upnp", DEFAULT_UPNP)) { | ||||
StartMapPort(); | StartMapPort(); | ||||
} | } | ||||
CConnman::Options connOptions; | CConnman::Options connOptions; | ||||
connOptions.nLocalServices = nLocalServices; | connOptions.nLocalServices = nLocalServices; | ||||
connOptions.nMaxConnections = nMaxConnections; | connOptions.nMaxConnections = nMaxConnections; | ||||
connOptions.nMaxOutbound = | connOptions.nMaxOutbound = | ||||
std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections); | std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections); | ||||
connOptions.nMaxAddnode = MAX_ADDNODE_CONNECTIONS; | connOptions.nMaxAddnode = MAX_ADDNODE_CONNECTIONS; | ||||
connOptions.nMaxFeeler = 1; | connOptions.nMaxFeeler = 1; | ||||
connOptions.nBestHeight = chainActive.Height(); | connOptions.nBestHeight = chain_active_height; | ||||
connOptions.uiInterface = &uiInterface; | connOptions.uiInterface = &uiInterface; | ||||
connOptions.m_msgproc = peerLogic.get(); | connOptions.m_msgproc = peerLogic.get(); | ||||
connOptions.nSendBufferMaxSize = | connOptions.nSendBufferMaxSize = | ||||
1000 * gArgs.GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER); | 1000 * gArgs.GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER); | ||||
connOptions.nReceiveFloodSize = | connOptions.nReceiveFloodSize = | ||||
1000 * gArgs.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER); | 1000 * gArgs.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER); | ||||
connOptions.m_added_nodes = gArgs.GetArgs("-addnode"); | connOptions.m_added_nodes = gArgs.GetArgs("-addnode"); | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |