Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 1,414 Lines • ▼ Show 20 Lines | switch (state.GetResult()) { | ||||
break; | break; | ||||
} | } | ||||
if (message != "") { | if (message != "") { | ||||
LogPrint(BCLog::NET, "peer=%d: %s\n", nodeid, message); | LogPrint(BCLog::NET, "peer=%d: %s\n", nodeid, message); | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
/** | bool PeerManager::MaybePunishNodeForTx(NodeId nodeid, | ||||
* Potentially ban a node based on the contents of a TxValidationState object | const TxValidationState &state, | ||||
* | const std::string &message) { | ||||
* @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 = "") { | |||||
switch (state.GetResult()) { | switch (state.GetResult()) { | ||||
case TxValidationResult::TX_RESULT_UNSET: | case TxValidationResult::TX_RESULT_UNSET: | ||||
break; | break; | ||||
// The node is providing invalid data: | // The node is providing invalid data: | ||||
case TxValidationResult::TX_CONSENSUS: | case TxValidationResult::TX_CONSENSUS: | ||||
Misbehaving(nodeid, 100, message); | Misbehaving(nodeid, 100, message); | ||||
return true; | return true; | ||||
// Conflicting (but not necessarily invalid) data or different policy: | // Conflicting (but not necessarily invalid) data or different policy: | ||||
▲ Show 20 Lines • Show All 4,083 Lines • Show Last 20 Lines |