Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
| Show First 20 Lines • Show All 1,043 Lines • ▼ Show 20 Lines | |||||
| #ifdef USE_UPNP | #ifdef USE_UPNP | ||||
| argsman.AddArg("-upnp", | argsman.AddArg("-upnp", | ||||
| strprintf("Use UPnP to map the listening port (default: %u)", | strprintf("Use UPnP to map the listening port (default: %u)", | ||||
| DEFAULT_UPNP), | DEFAULT_UPNP), | ||||
| ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||
| #else | #else | ||||
| hidden_args.emplace_back("-upnp"); | hidden_args.emplace_back("-upnp"); | ||||
| #endif | #endif | ||||
| #ifdef USE_NATPMP | |||||
| argsman.AddArg( | argsman.AddArg( | ||||
| "-natpmp", | "-natpmp", | ||||
| strprintf("Use NAT-PMP to map the listening port (default: %u)", | strprintf("Use PCP or NAT-PMP to map the listening port (default: %u)", | ||||
| DEFAULT_NATPMP), | DEFAULT_NATPMP), | ||||
| ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||
| #else | |||||
| hidden_args.emplace_back("-natpmp"); | |||||
| #endif // USE_NATPMP | |||||
| argsman.AddArg( | argsman.AddArg( | ||||
| "-whitebind=<[permissions@]addr>", | "-whitebind=<[permissions@]addr>", | ||||
| "Bind to the given address and add permission flags to the peers " | "Bind to the given address and add permission flags to the peers " | ||||
| "connecting to it." | "connecting to it." | ||||
| "Use [host]:port notation for IPv6. Allowed permissions: " + | "Use [host]:port notation for IPv6. Allowed permissions: " + | ||||
| Join(NET_PERMISSIONS_DOC, ", ") + | Join(NET_PERMISSIONS_DOC, ", ") + | ||||
| ". " | ". " | ||||
| "Specify multiple permissions separated by commas (default: " | "Specify multiple permissions separated by commas (default: " | ||||
| ▲ Show 20 Lines • Show All 1,943 Lines • ▼ Show 20 Lines | //// debug print | ||||
| tip_info->header_time = chainman.m_best_header->GetBlockTime(); | tip_info->header_time = chainman.m_best_header->GetBlockTime(); | ||||
| } | } | ||||
| } | } | ||||
| LogPrintf("nBestHeight = %d\n", chain_active_height); | LogPrintf("nBestHeight = %d\n", chain_active_height); | ||||
| if (node.peerman) { | if (node.peerman) { | ||||
| node.peerman->SetBestHeight(chain_active_height); | node.peerman->SetBestHeight(chain_active_height); | ||||
| } | } | ||||
| // Map ports with UPnP or NAT-PMP. | // Map ports with UPnP or NAT-PMP | ||||
| StartMapPort(args.GetBoolArg("-upnp", DEFAULT_UPNP), | StartMapPort(args.GetBoolArg("-upnp", DEFAULT_UPNP), | ||||
| args.GetBoolArg("-natpmp", DEFAULT_NATPMP)); | args.GetBoolArg("-natpmp", DEFAULT_NATPMP)); | ||||
| CConnman::Options connOptions; | CConnman::Options connOptions; | ||||
| connOptions.nLocalServices = nLocalServices; | connOptions.nLocalServices = nLocalServices; | ||||
| connOptions.nMaxConnections = nMaxConnections; | connOptions.nMaxConnections = nMaxConnections; | ||||
| connOptions.m_max_avalanche_outbound = | connOptions.m_max_avalanche_outbound = | ||||
| node.avalanche | node.avalanche | ||||
| ▲ Show 20 Lines • Show All 280 Lines • Show Last 20 Lines | |||||