aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-10-30 18:56:37 -0400
committerMatt Corallo <git@bluematt.me>2017-11-09 18:41:18 -0500
commitbe9f38c6131ab0c7ad96e4f6f3d8b5ae6f870ea9 (patch)
treec1eb34294a5c39304b360c541d07d0185c0eabb5 /src/util.h
parent3788a8479b4efd481f3e91419bcf347113375112 (diff)
downloadbitcoin-be9f38c6131ab0c7ad96e4f6f3d8b5ae6f870ea9.tar.xz
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.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 480a80c0a3..a0c4b33ad4 100644
--- a/src/util.h
+++ b/src/util.h
@@ -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)