Add -tor and related configuration

This commit is contained in:
Pieter Wuille
2012-05-01 21:04:07 +02:00
parent d077dd2a6e
commit 54ce3bad64
3 changed files with 30 additions and 6 deletions

View File

@@ -206,6 +206,14 @@ void static AdvertizeLocal()
}
}
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)
{
@@ -228,9 +236,7 @@ bool AddLocal(const CService& addr, int nScore)
info.nScore = nScore;
info.nPort = addr.GetPort() + (fAlready ? 1 : 0);
}
enum Network net = addr.GetNetwork();
vfReachable[net] = true;
if (net == NET_IPV6) vfReachable[NET_IPV4] = true;
SetReachable(addr.GetNetwork());
}
AdvertizeLocal();