Skip to content

Commit

Permalink
net: Allow AddLocal of Tor addresses even if we cannot reach Tor outb…
Browse files Browse the repository at this point in the history
…ound
  • Loading branch information
luke-jr committed Jan 15, 2025
1 parent 807a569 commit 57a23f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ bool AddLocal(const CService& addr_, int nScore)
if (!fDiscover && nScore < LOCAL_MANUAL)
return false;

if (!g_reachable_nets.Contains(addr))
// IPv4 and IPv6 cannot be connected to unless their networks are reachable, but Tor is not necessarily bidirectional
if (!(g_reachable_nets.Contains(addr) || addr.IsTor()))
return false;

LogPrintf("AddLocal(%s,%i)\n", addr.ToStringAddrPort(), nScore);
Expand Down

0 comments on commit 57a23f5

Please sign in to comment.