MCPcopy Create free account
hub / github.com/LUX-Core/lux / ThreadOpenAddedConnections

Function ThreadOpenAddedConnections

src/net.cpp:1559–1582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1557}
1558
1559void ThreadOpenAddedConnections()
1560{
1561 {
1562 LOCK(cs_vAddedNodes);
1563 vAddedNodes = mapMultiArgs["-addnode"];
1564 }
1565
1566 for (unsigned int i = 0; true; i++)
1567 {
1568 std::vector<AddedNodeInfo> vInfo = GetAddedNodeInfo();
1569 for (const AddedNodeInfo& info : vInfo) {
1570 if (!info.fConnected) {
1571 CSemaphoreGrant grant(*semOutbound);
1572 // If strAddedNode is an IP/port, decode it immediately, so
1573 // OpenNetworkConnection can detect existing connections to that IP/port.
1574 CService service(info.strAddedNode, Params().GetDefaultPort());
1575 OpenNetworkConnection(CAddress(service, NODE_NONE), false, &grant, info.strAddedNode.c_str(), false);
1576 MilliSleep(500);
1577 }
1578 }
1579 MilliSleep(120000); // Retry every 2 minutes
1580
1581 }
1582}
1583
1584double getVerificationProgress(const CBlockIndex *tipIn) // here to avoid include loops
1585{

Callers

nothing calls this directly

Calls 6

GetAddedNodeInfoFunction · 0.85
OpenNetworkConnectionFunction · 0.85
MilliSleepFunction · 0.85
GetDefaultPortMethod · 0.80
ParamsClass · 0.70
CAddressClass · 0.70

Tested by

no test coverage detected