diff --git a/src/avalanche/processor.h b/src/avalanche/processor.h --- a/src/avalanche/processor.h +++ b/src/avalanche/processor.h @@ -315,6 +315,8 @@ */ bool isAvalancheServiceAvailable() { return !!peerData; } + bool addPeer(const Proof &proof); + std::vector getPeers() const; std::vector getNodeIdsForPeer(PeerId peerId) const; diff --git a/src/avalanche/processor.cpp b/src/avalanche/processor.cpp --- a/src/avalanche/processor.cpp +++ b/src/avalanche/processor.cpp @@ -509,6 +509,11 @@ return peerData->proof; } +bool Processor::addPeer(const Proof &proof) { + LOCK(cs_peerManager); + return peerManager->getPeerId(proof) != NO_PEER; +} + bool Processor::startEventLoop(CScheduler &scheduler) { return eventLoop.startEventLoop( scheduler, [this]() { this->runEventLoop(); }, AVALANCHE_TIME_STEP); diff --git a/src/avalanche/proof.cpp b/src/avalanche/proof.cpp --- a/src/avalanche/proof.cpp +++ b/src/avalanche/proof.cpp @@ -9,6 +9,8 @@ #include #include