Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 1,554 Lines • ▼ Show 20 Lines | m_connman.ForEachNode([](CNode *pnode) { | ||||
| if (pnode->m_avalanche_state) { | if (pnode->m_avalanche_state) { | ||||
| pnode->m_avalanche_state->updateAvailabilityScore(); | pnode->m_avalanche_state->updateAvailabilityScore(); | ||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| void PeerManagerImpl::MaybeRequestAvalancheNodes(CScheduler &scheduler) const { | void PeerManagerImpl::MaybeRequestAvalancheNodes(CScheduler &scheduler) const { | ||||
| if (g_avalanche && | if (g_avalanche && | ||||
| (!g_avalanche->isQuorumEstablished() || | |||||
| g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | ||||
| return pm.shouldRequestMoreNodes(); | return pm.shouldRequestMoreNodes(); | ||||
| })) { | }))) { | ||||
| std::vector<NodeId> avanode_outbound_ids; | std::vector<NodeId> avanode_outbound_ids; | ||||
| m_connman.ForEachNode([&](CNode *pnode) { | m_connman.ForEachNode([&](CNode *pnode) { | ||||
| if (pnode->IsAvalancheOutboundConnection()) { | if (pnode->IsAvalancheOutboundConnection()) { | ||||
| avanode_outbound_ids.push_back(pnode->GetId()); | avanode_outbound_ids.push_back(pnode->GetId()); | ||||
| } | } | ||||
| }); | }); | ||||
| // Randomly select an avalanche outbound peer to send the getavaaddr | // Randomly select an avalanche outbound peer to send the getavaaddr | ||||
| ▲ Show 20 Lines • Show All 5,382 Lines • Show Last 20 Lines | |||||