aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2024-03-05 08:28:14 -0500
committerPieter Wuille <pieter@wuille.net>2024-05-30 08:35:18 -0400
commit6457c311977bba3585648e32e3bd5754028aa292 (patch)
treef5201780992f5a4b6b5b06b91f06a9606ca55b88 /src/net_processing.cpp
parent5120ab1478c200b18ee621a6ffa0362f4e991959 (diff)
net_processing: make all Misbehaving increments = 100
This removes the need to actually track misbehavior score (see further commit), because any Misbehaving node will immediately hit the discouragement threshold.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 7c7b6f2dfe..ea08038cf7 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1949,8 +1949,7 @@ bool PeerManagerImpl::MaybePunishNodeForBlock(NodeId nodeid, const BlockValidati
return true;
// Conflicting (but not necessarily invalid) data or different policy:
case BlockValidationResult::BLOCK_MISSING_PREV:
- // TODO: Handle this much more gracefully (10 DoS points is super arbitrary)
- if (peer) Misbehaving(*peer, 10, message);
+ if (peer) Misbehaving(*peer, 100, message);
return true;
case BlockValidationResult::BLOCK_RECENT_CONSENSUS_CHANGE:
case BlockValidationResult::BLOCK_TIME_FUTURE:
@@ -2690,7 +2689,7 @@ bool PeerManagerImpl::CheckHeadersPoW(const std::vector<CBlockHeader>& headers,
// Are these headers connected to each other?
if (!CheckHeadersAreContinuous(headers)) {
- Misbehaving(peer, 20, "non-continuous headers sequence");
+ Misbehaving(peer, 100, "non-continuous headers sequence");
return false;
}
return true;
@@ -4107,7 +4106,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
if (vAddr.size() > MAX_ADDR_TO_SEND)
{
- Misbehaving(*peer, 20, strprintf("%s message size = %u", msg_type, vAddr.size()));
+ Misbehaving(*peer, 100, strprintf("%s message size = %u", msg_type, vAddr.size()));
return;
}
@@ -4189,7 +4188,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
vRecv >> vInv;
if (vInv.size() > MAX_INV_SZ)
{
- Misbehaving(*peer, 20, strprintf("inv message size = %u", vInv.size()));
+ Misbehaving(*peer, 100, strprintf("inv message size = %u", vInv.size()));
return;
}
@@ -4281,7 +4280,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
vRecv >> vInv;
if (vInv.size() > MAX_INV_SZ)
{
- Misbehaving(*peer, 20, strprintf("getdata message size = %u", vInv.size()));
+ Misbehaving(*peer, 100, strprintf("getdata message size = %u", vInv.size()));
return;
}
@@ -4966,7 +4965,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
// Bypass the normal CBlock deserialization, as we don't want to risk deserializing 2000 full blocks.
unsigned int nCount = ReadCompactSize(vRecv);
if (nCount > MAX_HEADERS_RESULTS) {
- Misbehaving(*peer, 20, strprintf("headers message size = %u", nCount));
+ Misbehaving(*peer, 100, strprintf("headers message size = %u", nCount));
return;
}
headers.resize(nCount);