Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 438 Lines • ▼ Show 20 Lines | bool Processor::sendHello(CNode *pfrom) const { | ||||
connman->PushMessage(pfrom, CNetMsgMaker(pfrom->GetCommonVersion()) | connman->PushMessage(pfrom, CNetMsgMaker(pfrom->GetCommonVersion()) | ||||
.Make(NetMsgType::AVAHELLO, | .Make(NetMsgType::AVAHELLO, | ||||
Hello(peerData->delegation, sig))); | Hello(peerData->delegation, sig))); | ||||
return true; | return true; | ||||
} | } | ||||
const Proof Processor::getProof() const { | const Proof Processor::getLocalProof() const { | ||||
if (!peerData) { | if (!peerData) { | ||||
throw std::runtime_error("proof not set"); | throw std::runtime_error("proof not set"); | ||||
} | } | ||||
return peerData->proof; | return peerData->proof; | ||||
} | } | ||||
bool Processor::startEventLoop(CScheduler &scheduler) { | bool Processor::startEventLoop(CScheduler &scheduler) { | ||||
return eventLoop.startEventLoop( | return eventLoop.startEventLoop( | ||||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | std::vector<avalanche::Peer> Processor::getPeers() const { | ||||
return peerManager->getPeers(); | return peerManager->getPeers(); | ||||
} | } | ||||
std::vector<NodeId> Processor::getNodeIdsForPeer(PeerId peerId) const { | std::vector<NodeId> Processor::getNodeIdsForPeer(PeerId peerId) const { | ||||
LOCK(cs_peerManager); | LOCK(cs_peerManager); | ||||
return peerManager->getNodeIdsForPeer(peerId); | return peerManager->getNodeIdsForPeer(peerId); | ||||
} | } | ||||
const Proof *Processor::getProof(const ProofId proofId) const { | |||||
LOCK(cs_peerManager); | |||||
return peerManager->getProof(proofId); | |||||
} | |||||
bool Processor::addProof(Proof &&proof) { | |||||
LOCK(cs_peerManager); | |||||
return peerManager->addProof(std::move(proof)); | |||||
} | |||||
} // namespace avalanche | } // namespace avalanche |