mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-14 15:25:51 +02:00
net: add an add_even_if_unreachable argument to AddLocal
Prepare for letting explicitly configured local addresses bypass the reachable-net filter without tying that behavior to LOCAL_MANUAL score. Pass an `add_even_if_unreachable` bool through `AddLocal()`, defaulting to `false`.
This commit is contained in:
@@ -274,7 +274,7 @@ void ClearLocal()
|
||||
}
|
||||
|
||||
// learn a new local address
|
||||
bool AddLocal(const CService& addr_, int nScore)
|
||||
bool AddLocal(const CService& addr_, int nScore, bool add_even_if_unreachable)
|
||||
{
|
||||
CService addr{MaybeFlipIPv6toCJDNS(addr_)};
|
||||
|
||||
@@ -304,9 +304,9 @@ bool AddLocal(const CService& addr_, int nScore)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AddLocal(const CNetAddr &addr, int nScore)
|
||||
bool AddLocal(const CNetAddr& addr, int nScore, bool add_even_if_unreachable)
|
||||
{
|
||||
return AddLocal(CService(addr, GetListenPort()), nScore);
|
||||
return AddLocal(CService(addr, GetListenPort()), nScore, add_even_if_unreachable);
|
||||
}
|
||||
|
||||
void RemoveLocal(const CService& addr)
|
||||
|
||||
@@ -164,8 +164,8 @@ enum
|
||||
std::optional<CService> GetLocalAddrForPeer(CNode& node);
|
||||
|
||||
void ClearLocal();
|
||||
bool AddLocal(const CService& addr, int nScore = LOCAL_NONE);
|
||||
bool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE);
|
||||
bool AddLocal(const CService& addr, int nScore = LOCAL_NONE, bool add_even_if_unreachable = false);
|
||||
bool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE, bool add_even_if_unreachable = false);
|
||||
void RemoveLocal(const CService& addr);
|
||||
bool SeenLocal(const CService& addr);
|
||||
bool IsLocal(const CService& addr);
|
||||
|
||||
Reference in New Issue
Block a user