File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ std::optional<CService> GetLocalAddrForPeer(CNode& node)
275
275
CService MaybeFlipIPv6toCJDNS (const CService& service)
276
276
{
277
277
CService ret{service};
278
- if (ret.m_net == NET_IPV6 && ret.m_addr [ 0 ] == 0xfc && IsReachable (NET_CJDNS)) {
278
+ if (ret.m_net == NET_IPV6 && ret.HasCJDNSPrefix () && IsReachable (NET_CJDNS)) {
279
279
ret.m_net = NET_CJDNS;
280
280
}
281
281
return ret;
Original file line number Diff line number Diff line change @@ -450,8 +450,7 @@ bool CNetAddr::IsValid() const
450
450
return false ;
451
451
}
452
452
453
- // CJDNS addresses always start with 0xfc
454
- if (IsCJDNS () && (m_addr[0 ] != 0xFC )) {
453
+ if (IsCJDNS () && !HasCJDNSPrefix ()) {
455
454
return false ;
456
455
}
457
456
Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ class CNetAddr
182
182
bool IsTor () const ;
183
183
bool IsI2P () const ;
184
184
bool IsCJDNS () const ;
185
+ [[nodiscard]] bool HasCJDNSPrefix () const { return m_addr[0 ] == 0xfc ; }
185
186
bool IsLocal () const ;
186
187
bool IsRoutable () const ;
187
188
bool IsInternal () const ;
You can’t perform that action at this time.
0 commit comments