Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.cpp
Show First 20 Lines • Show All 485 Lines • ▼ Show 20 Lines | std::vector<NodeId> PeerManager::getNodeIdsForPeer(PeerId peerId) const { | ||||
auto &nview = nodes.get<next_request_time>(); | auto &nview = nodes.get<next_request_time>(); | ||||
auto nodeRange = nview.equal_range(peerId); | auto nodeRange = nview.equal_range(peerId); | ||||
for (auto it = nodeRange.first; it != nodeRange.second; ++it) { | for (auto it = nodeRange.first; it != nodeRange.second; ++it) { | ||||
nodeids.emplace_back(it->nodeid); | nodeids.emplace_back(it->nodeid); | ||||
} | } | ||||
return nodeids; | return nodeids; | ||||
} | } | ||||
bool PeerManager::isOrphan(const ProofId &id) { | bool PeerManager::isOrphan(const ProofId &id) const { | ||||
return orphanProofs.getProof(id) != nullptr; | return orphanProofs.getProof(id) != nullptr; | ||||
} | } | ||||
std::shared_ptr<Proof> PeerManager::getOrphan(const ProofId &id) const { | |||||
return orphanProofs.getProof(id); | |||||
} | |||||
} // namespace avalanche | } // namespace avalanche |