Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.cpp
Show First 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | auto nextCooldownTimePoint = | ||||
now + std::chrono::seconds( | now + std::chrono::seconds( | ||||
gArgs.GetArg("-avalancheconflictingproofcooldown", | gArgs.GetArg("-avalancheconflictingproofcooldown", | ||||
AVALANCHE_DEFAULT_CONFLICTING_PROOF_COOLDOWN)); | AVALANCHE_DEFAULT_CONFLICTING_PROOF_COOLDOWN)); | ||||
ProofPool::ConflictingProofSet conflictingProofs; | ProofPool::ConflictingProofSet conflictingProofs; | ||||
switch (validProofPool.addProofIfNoConflict(proof, conflictingProofs)) { | switch (validProofPool.addProofIfNoConflict(proof, conflictingProofs)) { | ||||
case ProofPool::AddProofStatus::REJECTED: { | case ProofPool::AddProofStatus::REJECTED: { | ||||
if (mode != RegistrationMode::FORCE_ACCEPT) { | if (mode != RegistrationMode::FORCE_ACCEPT) { | ||||
auto bestPossibleConflictTime = std::chrono::seconds(); | auto bestPossibleConflictTime = std::chrono::seconds(0); | ||||
auto &pview = peers.get<by_proofid>(); | auto &pview = peers.get<by_proofid>(); | ||||
for (auto &conflictingProof : conflictingProofs) { | for (auto &conflictingProof : conflictingProofs) { | ||||
auto it = pview.find(conflictingProof->getId()); | auto it = pview.find(conflictingProof->getId()); | ||||
assert(it != pview.end()); | assert(it != pview.end()); | ||||
// Search the most recent time over the peers | // Search the most recent time over the peers | ||||
bestPossibleConflictTime = std::max( | bestPossibleConflictTime = std::max( | ||||
bestPossibleConflictTime, it->nextPossibleConflictTime); | bestPossibleConflictTime, it->nextPossibleConflictTime); | ||||
▲ Show 20 Lines • Show All 541 Lines • Show Last 20 Lines |