diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2023-02-07 15:13:21 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2023-10-05 15:10:34 +0200 |
commit | 53afa68026ffa1313ae4aba3664de7791d23b1c8 (patch) | |
tree | 273b7bbf1d5491e8e219c9946ec35ee2635b8dd0 /src/netbase.cpp | |
parent | 6e308651c441cbf8763c67cc099c538c333c2872 (diff) | |
download | bitcoin-53afa68026ffa1313ae4aba3664de7791d23b1c8.tar.xz |
net: move MaybeFlipIPv6toCJDNS() from net to netbase
It need not be in the `net` module and we need to call it from
`LookupSubNet()`, thus move it to `netbase`.
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index 16b5e1c70d..09b8a606b6 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -774,3 +774,12 @@ bool IsBadPort(uint16_t port) } return false; } + +CService MaybeFlipIPv6toCJDNS(const CService& service) +{ + CService ret{service}; + if (ret.IsIPv6() && ret.HasCJDNSPrefix() && g_reachable_nets.Contains(NET_CJDNS)) { + ret.m_net = NET_CJDNS; + } + return ret; +} |