aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-05-01 21:04:07 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-06-23 01:11:38 +0200
commit54ce3bad64ea4dff64f16c12b287383ad96a875a (patch)
tree09dba5fc6f636d8c578e033d6b013f7018bf1119 /src/net.cpp
parentd077dd2a6ed4519d201a2a17ab151303ac3866f5 (diff)
Add -tor and related configuration
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp12
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();