Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 7,102 Lines • ▼ Show 20 Lines | bool PeerManagerImpl::ReceivedAvalancheProof(CNode &peer, | ||||
} | } | ||||
if (state.GetResult() == avalanche::ProofRegistrationResult::INVALID) { | if (state.GetResult() == avalanche::ProofRegistrationResult::INVALID) { | ||||
WITH_LOCK(cs_rejectedProofs, rejectedProofs->insert(proofid)); | WITH_LOCK(cs_rejectedProofs, rejectedProofs->insert(proofid)); | ||||
Misbehaving(nodeid, 100, state.GetRejectReason()); | Misbehaving(nodeid, 100, state.GetRejectReason()); | ||||
return false; | return false; | ||||
} | } | ||||
if (state.GetResult() == | |||||
avalanche::ProofRegistrationResult::COOLDOWN_NOT_ELAPSED) { | |||||
// Conflicting proofs are not necessarly adversarial, but if they are | |||||
// repeated within a short time period this is suspicious, so we affect | |||||
// a low ban score to our peer. | |||||
Misbehaving(nodeid, 5, state.GetRejectReason()); | |||||
return false; | |||||
} | |||||
if (!g_avalanche->addProofToReconcile(proof)) { | if (!g_avalanche->addProofToReconcile(proof)) { | ||||
LogPrint(BCLog::AVALANCHE, | LogPrint(BCLog::AVALANCHE, | ||||
"Not polling the avalanche proof (%s): peer=%d, proofid %s\n", | "Not polling the avalanche proof (%s): peer=%d, proofid %s\n", | ||||
state.IsValid() ? "not-worth-polling" | state.IsValid() ? "not-worth-polling" | ||||
: state.GetRejectReason(), | : state.GetRejectReason(), | ||||
nodeid, proofid.ToString()); | nodeid, proofid.ToString()); | ||||
} | } | ||||
return true; | return true; | ||||
} | } |