Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.cpp
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | if ((mode != RegistrationMode::FORCE_ACCEPT || | ||||
// In forced accept mode, the proof can be in the conflicting pool. | // In forced accept mode, the proof can be in the conflicting pool. | ||||
return invalidate(ProofRegistrationResult::ALREADY_REGISTERED, | return invalidate(ProofRegistrationResult::ALREADY_REGISTERED, | ||||
"proof-already-registered"); | "proof-already-registered"); | ||||
} | } | ||||
if (danglingProofIds.contains(proofid) && | if (danglingProofIds.contains(proofid) && | ||||
pendingNodes.count(proofid) == 0) { | pendingNodes.count(proofid) == 0) { | ||||
// Don't attempt to register a proof that we already evicted because it | // Don't attempt to register a proof that we already evicted because it | ||||
// was dangling. | // was dangling, but rather attempt to retrieve an associated node. | ||||
needMoreNodes = true; | |||||
return invalidate(ProofRegistrationResult::DANGLING, "dangling-proof"); | return invalidate(ProofRegistrationResult::DANGLING, "dangling-proof"); | ||||
} | } | ||||
// Check the proof's validity. | // Check the proof's validity. | ||||
ProofValidationState validationState; | ProofValidationState validationState; | ||||
if (!WITH_LOCK(cs_main, return proof->verify(validationState, chainman))) { | if (!WITH_LOCK(cs_main, return proof->verify(validationState, chainman))) { | ||||
if (isOrphanState(validationState)) { | if (isOrphanState(validationState)) { | ||||
orphanProofPool.addProofIfPreferred(proof); | orphanProofPool.addProofIfPreferred(proof); | ||||
▲ Show 20 Lines • Show All 578 Lines • Show Last 20 Lines |