Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 503 Lines • ▼ Show 20 Lines | |||||
const Proof Processor::getProof() const { | const Proof Processor::getProof() 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::addPeer(const Proof &proof) { | |||||
LOCK(cs_peerManager); | |||||
return peerManager->getPeerId(proof) != NO_PEER; | |||||
} | |||||
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 |