Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 496 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; | ||||
} | } | ||||
bool Processor::addProof(const std::shared_ptr<Proof> &proof) { | |||||
LOCK(cs_peerManager); | |||||
return !peerManager->getProof(proof->getId()) && | |||||
peerManager->getPeerId(proof) != NO_PEER; | |||||
} | |||||
std::shared_ptr<Proof> Processor::getProof(const ProofId &proofid) const { | |||||
LOCK(cs_peerManager); | |||||
return peerManager->getProof(proofid); | |||||
} | |||||
bool Processor::startEventLoop(CScheduler &scheduler) { | bool Processor::startEventLoop(CScheduler &scheduler) { | ||||
return eventLoop.startEventLoop( | return eventLoop.startEventLoop( | ||||
scheduler, [this]() { this->runEventLoop(); }, AVALANCHE_TIME_STEP); | scheduler, [this]() { this->runEventLoop(); }, AVALANCHE_TIME_STEP); | ||||
} | } | ||||
bool Processor::stopEventLoop() { | bool Processor::stopEventLoop() { | ||||
return eventLoop.stopEventLoop(); | return eventLoop.stopEventLoop(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |