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 5,079 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::AVAPROOF) { | ||||
LogPrint(BCLog::NET, "New avalanche proof: peer=%d, proofid %s\n", | LogPrint(BCLog::NET, "New avalanche proof: peer=%d, proofid %s\n", | ||||
nodeid, proofid.ToString()); | nodeid, proofid.ToString()); | ||||
} | } | ||||
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; | |||||
} | |||||
if (!gArgs.GetBoolArg("-enableavalancheproofreplacement", | |||||
AVALANCHE_DEFAULT_PROOF_REPLACEMENT_ENABLED)) { | |||||
// If proof replacement is not enabled there is no point dealing | |||||
// with proof polling, so we're done. | |||||
return; | |||||
} | } | ||||
if (state.IsValid() || | |||||
state.GetResult() == | |||||
avalanche::ProofRegistrationResult::CONFLICTING) { | |||||
g_avalanche->addProofToReconcile(proof); | |||||
return; | |||||
} | |||||
LogPrint(BCLog::AVALANCHE, | |||||
"Not polling the avalanche proof (%s): peer=%d, proofid %s\n", | |||||
state.GetRejectReason(), nodeid, proofid.ToString()); | |||||
return; | return; | ||||
} | } | ||||
if (msg_type == NetMsgType::GETADDR) { | if (msg_type == NetMsgType::GETADDR) { | ||||
// This asymmetric behavior for inbound and outbound connections was | // This asymmetric behavior for inbound and outbound connections was | ||||
// introduced to prevent a fingerprinting attack: an attacker can send | // introduced to prevent a fingerprinting attack: an attacker can send | ||||
// specific fake addresses to users' AddrMan and later request them by | // specific fake addresses to users' AddrMan and later request them by | ||||
// sending getaddr messages. Making nodes which are behind NAT and can | // sending getaddr messages. Making nodes which are behind NAT and can | ||||
▲ Show 20 Lines • Show All 1,689 Lines • Show Last 20 Lines |