@@ -105,10 +105,10 @@ std::map<CNetAddr, LocalServiceInfo> mapLocalHost GUARDED_BY(cs_mapLocalHost);
105
105
static bool vfLimited[NET_MAX] GUARDED_BY(cs_mapLocalHost) = {};
106
106
std::string strSubVersion;
107
107
108
- void CConnman::AddOneShot (const std::string& strDest)
108
+ void CConnman::AddAddrFetch (const std::string& strDest)
109
109
{
110
- LOCK (cs_vOneShots );
111
- vOneShots .push_back (strDest);
110
+ LOCK (m_addr_fetches_mutex );
111
+ m_addr_fetches .push_back (strDest);
112
112
}
113
113
114
114
uint16_t GetListenPort ()
@@ -1646,7 +1646,7 @@ void CConnman::ThreadDNSAddressSeed()
1646
1646
{
1647
1647
LOCK (cs_vNodes);
1648
1648
for (const CNode* pnode : vNodes) {
1649
- nRelevant += pnode->fSuccessfullyConnected && !pnode->fFeeler && !pnode->fOneShot && !pnode->m_manual_connection && !pnode->fInbound ;
1649
+ nRelevant += pnode->fSuccessfullyConnected && !pnode->fFeeler && !pnode->m_addr_fetch && !pnode->m_manual_connection && !pnode->fInbound ;
1650
1650
}
1651
1651
}
1652
1652
if (nRelevant >= 2 ) {
@@ -1674,7 +1674,7 @@ void CConnman::ThreadDNSAddressSeed()
1674
1674
1675
1675
LogPrintf (" Loading addresses from DNS seed %s\n " , seed);
1676
1676
if (HaveNameProxy ()) {
1677
- AddOneShot (seed);
1677
+ AddAddrFetch (seed);
1678
1678
} else {
1679
1679
std::vector<CNetAddr> vIPs;
1680
1680
std::vector<CAddress> vAdd;
@@ -1696,8 +1696,8 @@ void CConnman::ThreadDNSAddressSeed()
1696
1696
addrman.Add (vAdd, resolveSource);
1697
1697
} else {
1698
1698
// We now avoid directly using results from DNS Seeds which do not support service bit filtering,
1699
- // instead using them as a oneshot to get nodes with our desired service bits.
1700
- AddOneShot (seed);
1699
+ // instead using them as a addrfetch to get nodes with our desired service bits.
1700
+ AddAddrFetch (seed);
1701
1701
}
1702
1702
}
1703
1703
--seeds_right_now;
@@ -1727,15 +1727,15 @@ void CConnman::DumpAddresses()
1727
1727
addrman.size (), GetTimeMillis () - nStart);
1728
1728
}
1729
1729
1730
- void CConnman::ProcessOneShot ()
1730
+ void CConnman::ProcessAddrFetch ()
1731
1731
{
1732
1732
std::string strDest;
1733
1733
{
1734
- LOCK (cs_vOneShots );
1735
- if (vOneShots .empty ())
1734
+ LOCK (m_addr_fetches_mutex );
1735
+ if (m_addr_fetches .empty ())
1736
1736
return ;
1737
- strDest = vOneShots .front ();
1738
- vOneShots .pop_front ();
1737
+ strDest = m_addr_fetches .front ();
1738
+ m_addr_fetches .pop_front ();
1739
1739
}
1740
1740
CAddress addr;
1741
1741
CSemaphoreGrant grant (*semOutbound, true );
@@ -1767,7 +1767,7 @@ int CConnman::GetExtraOutboundCount()
1767
1767
{
1768
1768
LOCK (cs_vNodes);
1769
1769
for (const CNode* pnode : vNodes) {
1770
- if (!pnode->fInbound && !pnode->m_manual_connection && !pnode->fFeeler && !pnode->fDisconnect && !pnode->fOneShot && pnode->fSuccessfullyConnected ) {
1770
+ if (!pnode->fInbound && !pnode->m_manual_connection && !pnode->fFeeler && !pnode->fDisconnect && !pnode->m_addr_fetch && pnode->fSuccessfullyConnected ) {
1771
1771
++nOutbound;
1772
1772
}
1773
1773
}
@@ -1782,7 +1782,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
1782
1782
{
1783
1783
for (int64_t nLoop = 0 ;; nLoop++)
1784
1784
{
1785
- ProcessOneShot ();
1785
+ ProcessAddrFetch ();
1786
1786
for (const std::string& strAddr : connect)
1787
1787
{
1788
1788
CAddress addr (CService (), NODE_NONE);
@@ -1805,7 +1805,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
1805
1805
int64_t nNextFeeler = PoissonNextSend (nStart*1000 *1000 , FEELER_INTERVAL);
1806
1806
while (!interruptNet)
1807
1807
{
1808
- ProcessOneShot ();
1808
+ ProcessAddrFetch ();
1809
1809
1810
1810
if (!interruptNet.sleep_for (std::chrono::milliseconds (500 )))
1811
1811
return ;
@@ -2039,7 +2039,7 @@ void CConnman::ThreadOpenAddedConnections()
2039
2039
}
2040
2040
2041
2041
// if successful, this moves the passed grant to the constructed node
2042
- void CConnman::OpenNetworkConnection (const CAddress& addrConnect, bool fCountFailure , CSemaphoreGrant *grantOutbound, const char *pszDest, bool fOneShot , bool fFeeler , bool manual_connection, bool block_relay_only)
2042
+ void CConnman::OpenNetworkConnection (const CAddress& addrConnect, bool fCountFailure , CSemaphoreGrant *grantOutbound, const char *pszDest, bool m_addr_fetch , bool fFeeler , bool manual_connection, bool block_relay_only)
2043
2043
{
2044
2044
//
2045
2045
// Initiate outbound network connection
@@ -2064,8 +2064,8 @@ void CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
2064
2064
return ;
2065
2065
if (grantOutbound)
2066
2066
grantOutbound->MoveTo (pnode->grantOutbound );
2067
- if (fOneShot )
2068
- pnode->fOneShot = true ;
2067
+ if (m_addr_fetch )
2068
+ pnode->m_addr_fetch = true ;
2069
2069
if (fFeeler )
2070
2070
pnode->fFeeler = true ;
2071
2071
if (manual_connection)
@@ -2337,7 +2337,7 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
2337
2337
}
2338
2338
2339
2339
for (const auto & strDest : connOptions.vSeedNodes ) {
2340
- AddOneShot (strDest);
2340
+ AddAddrFetch (strDest);
2341
2341
}
2342
2342
2343
2343
if (clientInterface) {
0 commit comments