Remove vfReachable and modify IsReachable to only use vfLimited.
We do not know that a class of Network is reachable, only that it is not.
Github-Pull: #7553
Rebased-From: 110b62f069
This commit is contained in:
committed by
MarcoFalke
parent
52c101158f
commit
a5bc6a1bc4
12
src/net.cpp
12
src/net.cpp
@@ -77,7 +77,6 @@ bool fListen = true;
|
||||
uint64_t nLocalServices = NODE_NETWORK;
|
||||
CCriticalSection cs_mapLocalHost;
|
||||
map<CNetAddr, LocalServiceInfo> mapLocalHost;
|
||||
static bool vfReachable[NET_MAX] = {};
|
||||
static bool vfLimited[NET_MAX] = {};
|
||||
static CNode* pnodeLocalHost = NULL;
|
||||
uint64_t nLocalHostNonce = 0;
|
||||
@@ -224,14 +223,6 @@ void AdvertiseLocal(CNode *pnode)
|
||||
}
|
||||
}
|
||||
|
||||
void SetReachable(enum Network net, bool fFlag)
|
||||
{
|
||||
LOCK(cs_mapLocalHost);
|
||||
vfReachable[net] = fFlag;
|
||||
if (net == NET_IPV6 && fFlag)
|
||||
vfReachable[NET_IPV4] = true;
|
||||
}
|
||||
|
||||
// learn a new local address
|
||||
bool AddLocal(const CService& addr, int nScore)
|
||||
{
|
||||
@@ -254,7 +245,6 @@ bool AddLocal(const CService& addr, int nScore)
|
||||
info.nScore = nScore + (fAlready ? 1 : 0);
|
||||
info.nPort = addr.GetPort();
|
||||
}
|
||||
SetReachable(addr.GetNetwork());
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -317,7 +307,7 @@ bool IsLocal(const CService& addr)
|
||||
bool IsReachable(enum Network net)
|
||||
{
|
||||
LOCK(cs_mapLocalHost);
|
||||
return vfReachable[net] && !vfLimited[net];
|
||||
return !vfLimited[net];
|
||||
}
|
||||
|
||||
/** check whether a given address is in a network we can probably connect to */
|
||||
|
||||
Reference in New Issue
Block a user