diff options
| author | John Newbery <[email protected]> | 2020-08-24 15:56:14 +0100 |
|---|---|---|
| committer | John Newbery <[email protected]> | 2020-09-07 11:16:12 +0100 |
| commit | b70cd890e375e904b7f36b3d959e5656f5a5cbcd (patch) | |
| tree | 3d8f0f93e37e9545da428157862bd878120d2808 /src/net_processing.cpp | |
| parent | [net processing] Move ProcessHeadersMessage to PeerManager (diff) | |
| download | discoin-b70cd890e375e904b7f36b3d959e5656f5a5cbcd.tar.xz discoin-b70cd890e375e904b7f36b3d959e5656f5a5cbcd.zip | |
[net processing] Move MaybePunishNodeForBlock into PeerManager
Diffstat (limited to 'src/net_processing.cpp')
| -rw-r--r-- | src/net_processing.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index fac0f100d..79d1ebe3a 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1132,17 +1132,9 @@ void Misbehaving(const NodeId pnode, const int howmuch, const std::string& messa } } -/** - * Potentially mark a node discouraged based on the contents of a BlockValidationState object - * - * @param[in] via_compact_block this bool is passed in because net_processing should - * punish peers differently depending on whether the data was provided in a compact - * block message or not. If the compact block had a valid header, but contained invalid - * txs, the peer should not be punished. See BIP 152. - * - * @return Returns true if the peer was punished (probably disconnected) - */ -static bool MaybePunishNodeForBlock(NodeId nodeid, const BlockValidationState& state, bool via_compact_block, const std::string& message = "") { +bool PeerManager::MaybePunishNodeForBlock(NodeId nodeid, const BlockValidationState& state, + bool via_compact_block, const std::string& message) +{ switch (state.GetResult()) { case BlockValidationResult::BLOCK_RESULT_UNSET: break; |