diff options
author | John Newbery <john@johnnewbery.com> | 2020-08-24 16:56:15 +0100 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2020-09-07 11:16:12 +0100 |
commit | bb6a32ce9983c72afa90f41a43a47ffd703ca006 (patch) | |
tree | 5623c972c02aafaeab21159052bb0e2778d62551 /src/net_processing.h | |
parent | aa114b1c9b06c2bd3ed936bbb9fb32b31f75bdb2 (diff) |
[net processing] Move Misbehaving() to PeerManager
Diffstat (limited to 'src/net_processing.h')
-rw-r--r-- | src/net_processing.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net_processing.h b/src/net_processing.h index c89fdb601b..520f7489e8 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -86,6 +86,13 @@ public: void ProcessMessage(CNode& pfrom, const std::string& msg_type, CDataStream& vRecv, const std::chrono::microseconds time_received, const std::atomic<bool>& interruptMsgProc); + /** + * Increment peer's misbehavior score. If the new value >= DISCOURAGEMENT_THRESHOLD, mark the node + * to be discouraged, meaning the peer might be disconnected and added to the discouragement filter. + * Public for unit testing. + */ + void Misbehaving(const NodeId pnode, const int howmuch, const std::string& message); + private: /** * Potentially mark a node discouraged based on the contents of a BlockValidationState object |