0xb10c d4d184eda9
log: don't rate-limit "new peer" with -debug=net
Previously, when `debug=net` is enabled, we log "New [..] peer connected"
for new inbound peers with `LogInfo`. However, `LogInfo` will get
rate-limited since https://github.com/bitcoin/bitcoin/pull/32604.
When we specifically turn on `debug=net`, we don't want these log
messages to be rate-limited.

To fix this, use `LogDebug(BCLog::NET, ...)` for potentially high-
rate inbound connections. Otherwise use `LogInfo`. This means we
don't rate-limit the messages for inbound peers when `debug=net`
is turned on but will rate-limit if we created outbound at a high
rate as these are logged via `LogInfo`.

--

I ran into this message getting rate-limited on one of my monitoring
nodes with `-logsourcelocations=1`: With logsourcelocations, one of
these lines is about 338 chars (or 338 bytes) long. We rate-limit
after more than 1048576 bytes per hour, which results in about
3100 in- and outbound connections per hour. With evicted and
instantly reconnecting connections from an entity like LinkingLion,
this can be reached fairly quickly.

Co-Authored-By: Eugene Siegel <elzeigel@gmail.com>
Co-Authored-By: Anthony Towns <aj@erisian.com.au>
2025-12-09 13:05:16 +01:00
..
2025-12-04 19:52:49 +01:00
2025-10-28 15:33:57 +00:00
2025-11-27 14:33:57 +01:00
2025-05-19 16:40:33 +01:00
2025-09-03 11:23:30 +01:00
2025-05-19 16:40:33 +01:00
2025-09-30 11:06:43 -07:00
2025-12-04 19:53:06 +01:00
2025-09-30 11:06:43 -07:00
2025-11-14 01:17:38 +02:00
2025-11-14 01:17:38 +02:00
2025-11-27 14:33:57 +01:00
2025-11-27 14:33:57 +01:00
2025-11-30 10:57:48 -05:00
2025-04-09 15:59:59 +01:00
2025-04-09 15:59:59 +01:00