diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-01-18 17:21:08 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-01-24 12:18:29 +0100 |
commit | d3a185a33b7bc09e4ca998f42f1f9aea8177ef8a (patch) | |
tree | 03951b5ebc0b7302b4399d066e688eb7fbfc4372 /src/net_processing.h | |
parent | 898f560b55aba2070f188b0223ef2beefcdede8b (diff) |
net: Move misbehaving logging to net logging category
This moves the error messages for misbehavior (when available) into the
line that reports the misbehavior, as well as moves the logging to the
`net` category.
This is a continuation of #11583 and avoids serious-looking errors due
to misbehaving peers.
To do this, Misbehaving() gains an optional `message` argument.
E.g. change:
2018-01-18 16:02:27 Misbehaving: x.x.x.x:62174 peer=164603 (80 -> 100) BAN THRESHOLD EXCEEDED
2018-01-18 16:02:27 ERROR: non-continuous headers sequence
to
2018-01-18 16:02:27 Misbehaving: x.x.x.x:62174 peer=164603 (80 -> 100) BAN THRESHOLD EXCEEDED: non-continuous headers sequence
Diffstat (limited to 'src/net_processing.h')
-rw-r--r-- | src/net_processing.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net_processing.h b/src/net_processing.h index 4f2b8935f4..b534ef01c3 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -79,6 +79,6 @@ struct CNodeStateStats { /** Get statistics from node state */ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); /** Increase a node's misbehavior score. */ -void Misbehaving(NodeId nodeid, int howmuch); +void Misbehaving(NodeId nodeid, int howmuch, const std::string& message=""); #endif // BITCOIN_NET_PROCESSING_H |