diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-05-01 21:04:07 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-06-23 01:11:38 +0200 |
commit | 54ce3bad64ea4dff64f16c12b287383ad96a875a (patch) | |
tree | 09dba5fc6f636d8c578e033d6b013f7018bf1119 /src/net.cpp | |
parent | d077dd2a6ed4519d201a2a17ab151303ac3866f5 (diff) |
Add -tor and related configuration
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index 804cb0f543..441d28bb91 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -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(); |