mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 21:57:54 +02:00
Merge bitcoin/bitcoin#34458: net: Don't log own ips during discover
a49f97ff4anet: Don't log own ips during discover (sedited) Pull request description: The -logips option seems to imply that ip addresses are only logged when it is set. This seems like an obvious case for not logging these by default. There might be prior discussion around this, but I was unable to find why these might be exempt. There are also a few issues (both open and closed) where printing these lines was useful. ACKs for top commit: l0rinc: tested ACKa49f97ff4aachow101: ACKa49f97ff4awillcl-ark: tACKa49f97ff4adanielabrozzoni: tACKa49f97ff4aTree-SHA512: 177911c5607b794965facf568fec71eb22fc8e9d16f4fee5088745e8aba51cb4ce839876c456470dc52839ebc36976dc6b81a50f546941aebb8db538d8fd4554
This commit is contained in:
12
src/net.cpp
12
src/net.cpp
@@ -287,7 +287,9 @@ bool AddLocal(const CService& addr_, int nScore)
|
||||
if (!g_reachable_nets.Contains(addr))
|
||||
return false;
|
||||
|
||||
LogInfo("AddLocal(%s,%i)\n", addr.ToStringAddrPort(), nScore);
|
||||
if (fLogIPs) {
|
||||
LogInfo("AddLocal(%s,%i)\n", addr.ToStringAddrPort(), nScore);
|
||||
}
|
||||
|
||||
{
|
||||
LOCK(g_maplocalhost_mutex);
|
||||
@@ -310,7 +312,10 @@ bool AddLocal(const CNetAddr &addr, int nScore)
|
||||
void RemoveLocal(const CService& addr)
|
||||
{
|
||||
LOCK(g_maplocalhost_mutex);
|
||||
LogInfo("RemoveLocal(%s)\n", addr.ToStringAddrPort());
|
||||
if (fLogIPs) {
|
||||
LogInfo("RemoveLocal(%s)\n", addr.ToStringAddrPort());
|
||||
}
|
||||
|
||||
mapLocalHost.erase(addr);
|
||||
}
|
||||
|
||||
@@ -3349,8 +3354,9 @@ void Discover()
|
||||
return;
|
||||
|
||||
for (const CNetAddr &addr: GetLocalAddresses()) {
|
||||
if (AddLocal(addr, LOCAL_IF))
|
||||
if (AddLocal(addr, LOCAL_IF) && fLogIPs) {
|
||||
LogInfo("%s: %s\n", __func__, addr.ToStringAddr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user