Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 667 Lines • ▼ Show 20 Lines | void Processor::avaproofsSent(NodeId nodeid) { | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* 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() { | ||||
{ | |||||
LOCK(cs_peerManager); | |||||
if (peerManager->getNodeCount() < 8) { | |||||
sdulfari: This needs a comment why we short circuit before checking the latch. | |||||
// There is no point polling if we know the vote cannot converge | |||||
sdulfariUnsubmitted Not Done Inline ActionsThis comment conflates this function call with polling. While mostly true, it's also used in periodic networking. sdulfari: This comment conflates this function call with polling. While mostly true, it's also used in… | |||||
return false; | |||||
} | |||||
} | |||||
if (quorumIsEstablished) { | if (quorumIsEstablished) { | ||||
return true; | return true; | ||||
} | } | ||||
// Don't do Avalanche while node is IBD'ing | // Don't do Avalanche while node is IBD'ing | ||||
if (chainman.ActiveChainstate().IsInitialBlockDownload()) { | if (chainman.ActiveChainstate().IsInitialBlockDownload()) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 272 Lines • Show Last 20 Lines |
This needs a comment why we short circuit before checking the latch.