aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-12-11 16:44:02 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-12-11 17:06:22 +0100
commit37ffa16933953565dcab5c0d7e0ee1ebb6e349c3 (patch)
tree69f21301e6f16ded9ebe5693120d54c4173ef139 /src/util.h
parent8ab6c0b09e4e734e3033d81fe0a25f09ca74ba26 (diff)
parentbe9f38c6131ab0c7ad96e4f6f3d8b5ae6f870ea9 (diff)
downloadbitcoin-37ffa16933953565dcab5c0d7e0ee1ebb6e349c3.tar.xz
Merge #11583: Do not make it trivial for inbound peers to generate log entries
be9f38c Do not make it trivial for inbound peers to generate log entries (Matt Corallo) Pull request description: Based on #11580 because I'm lazy. 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). Tree-SHA512: 8e59c8d08d00b1527951b30f4842d010a4c2fc440503ade112baa2c1b9afd0e0d1c5c2df83dde25183a242af45089cf9b9f873b71796771232ffb6c5fc6cc0cc
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 6687b865d2..3cc4c26817 100644
--- a/src/util.h
+++ b/src/util.h
@@ -134,6 +134,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)