[net processing] Move Misbehaving() to PeerManager

This commit is contained in:
John Newbery
2020-08-24 16:56:15 +01:00
parent aa114b1c9b
commit bb6a32ce99
3 changed files with 12 additions and 10 deletions

View File

@@ -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