mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 21:57:54 +02:00
net: Don't log own ips during discover
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.
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);
|
||||
}
|
||||
|
||||
@@ -3345,8 +3350,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