Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 762 Lines • ▼ Show 20 Lines | for (const auto &p : timedout_items) { | ||||
if (!clearInflightRequest(proofVoteRecords, proof, p.second)) { | if (!clearInflightRequest(proofVoteRecords, proof, p.second)) { | ||||
continue; | continue; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void Processor::runEventLoop() { | void Processor::runEventLoop() { | ||||
// Don't do Avalanche while node is IBD'ing | |||||
if (::ChainstateActive().IsInitialBlockDownload()) { | |||||
return; | |||||
} | |||||
// Don't poll if quorum hasn't been established yet | // Don't poll if quorum hasn't been established yet | ||||
if (!isQuorumEstablished()) { | if (!isQuorumEstablished()) { | ||||
return; | return; | ||||
} | } | ||||
// First things first, check if we have requests that timed out and clear | // First things first, check if we have requests that timed out and clear | ||||
// them. | // them. | ||||
clearTimedoutRequests(); | clearTimedoutRequests(); | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
* Returns a bool indicating whether we have a usable Avalanche quorum enabling | * Returns a bool indicating whether we have a usable Avalanche quorum enabling | ||||
* us to take decisions based on polls. | * us to take decisions based on polls. | ||||
*/ | */ | ||||
bool Processor::isQuorumEstablished() { | bool Processor::isQuorumEstablished() { | ||||
if (quorumIsEstablished) { | if (quorumIsEstablished) { | ||||
return true; | return true; | ||||
} | } | ||||
// Don't do Avalanche while node is IBD'ing | |||||
if (::ChainstateActive().IsInitialBlockDownload()) { | |||||
return false; | |||||
} | |||||
if (avaproofsNodeCounter < minAvaproofsNodeCount) { | if (avaproofsNodeCounter < minAvaproofsNodeCount) { | ||||
return false; | return false; | ||||
} | } | ||||
auto localProof = getLocalProof(); | auto localProof = getLocalProof(); | ||||
// Get the registered proof score and registered score we have nodes for | // Get the registered proof score and registered score we have nodes for | ||||
uint32_t totalPeersScore; | uint32_t totalPeersScore; | ||||
Show All 38 Lines |