Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.cpp
Show First 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | bool PeerManager::rejectProof(const ProofId &proofid, RejectionMode mode) { | ||||
const ProofRef proof = it->proof; | const ProofRef proof = it->proof; | ||||
if (!removePeer(it->peerid)) { | if (!removePeer(it->peerid)) { | ||||
return false; | return false; | ||||
} | } | ||||
// If there was conflicting proofs, attempt to pull them back | // If there was conflicting proofs, attempt to pull them back | ||||
for (const SignedStake &ss : it->proof->getStakes()) { | for (const SignedStake &ss : proof->getStakes()) { | ||||
const ProofRef conflictingProof = | const ProofRef conflictingProof = | ||||
conflictingProofPool.getProof(ss.getStake().getUTXO()); | conflictingProofPool.getProof(ss.getStake().getUTXO()); | ||||
if (!conflictingProof) { | if (!conflictingProof) { | ||||
continue; | continue; | ||||
} | } | ||||
conflictingProofPool.removeProof(conflictingProof->getId()); | conflictingProofPool.removeProof(conflictingProof->getId()); | ||||
registerProof(conflictingProof); | registerProof(conflictingProof); | ||||
▲ Show 20 Lines • Show All 343 Lines • Show Last 20 Lines |