diff --git a/src/net_processing.h b/src/net_processing.h --- a/src/net_processing.h +++ b/src/net_processing.h @@ -19,6 +19,7 @@ class CTxMemPool; class ChainstateManager; class Config; +class TxValidationState; /** * Default for -maxorphantx, maximum number of orphan transactions kept in @@ -142,6 +143,15 @@ bool via_compact_block, const std::string &message = ""); + /** + * Potentially disconnect and discourage a node based on the contents of a + * TxValidationState object + * + * @return Returns true if the peer was punished (probably disconnected) + */ + bool MaybePunishNodeForTx(NodeId nodeid, const TxValidationState &state, + const std::string &message = ""); + /** * Maybe disconnect a peer and discourage future connections from its * address. diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1420,15 +1420,9 @@ return false; } -/** - * Potentially ban a node based on the contents of a TxValidationState object - * - * @return Returns true if the peer was punished (probably disconnected) - * - * Changes here may need to be reflected in TxRelayMayResultInDisconnect(). - */ -static bool MaybePunishNodeForTx(NodeId nodeid, const TxValidationState &state, - const std::string &message = "") { +bool PeerManager::MaybePunishNodeForTx(NodeId nodeid, + const TxValidationState &state, + const std::string &message) { switch (state.GetResult()) { case TxValidationResult::TX_RESULT_UNSET: break;