mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Do not make it trivial for inbound peers to generate log entries
We should generally avoid writing to debug.log unconditionally for inbound peers which misbehave (the peer being about to be banned being an exception, since they cannot do this twice). To avoid removing logs for outbound peers, a new log is added to notify users when a new outbound peer is connected which mimics the version print.
This commit is contained in:
@@ -132,6 +132,10 @@ template<typename T, typename... Args> static inline void MarkUsed(const T& t, c
|
||||
MarkUsed(args...);
|
||||
}
|
||||
|
||||
// Be conservative when using LogPrintf/error or other things which
|
||||
// unconditionally log to debug.log! It should not be the case that an inbound
|
||||
// peer can fill up a users disk with debug.log entries.
|
||||
|
||||
#ifdef USE_COVERAGE
|
||||
#define LogPrintf(...) do { MarkUsed(__VA_ARGS__); } while(0)
|
||||
#define LogPrint(category, ...) do { MarkUsed(__VA_ARGS__); } while(0)
|
||||
|
||||
Reference in New Issue
Block a user