Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.h
// Copyright (c) 2018-2019 The Bitcoin developers | // Copyright (c) 2018-2019 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_AVALANCHE_PROCESSOR_H | #ifndef BITCOIN_AVALANCHE_PROCESSOR_H | ||||
#define BITCOIN_AVALANCHE_PROCESSOR_H | #define BITCOIN_AVALANCHE_PROCESSOR_H | ||||
#include <avalanche/node.h> | #include <avalanche/node.h> | ||||
#include <avalanche/peermanager.h> | |||||
#include <avalanche/protocol.h> | #include <avalanche/protocol.h> | ||||
#include <blockindexworkcomparator.h> | #include <blockindexworkcomparator.h> | ||||
#include <eventloop.h> | #include <eventloop.h> | ||||
#include <interfaces/chain.h> | #include <interfaces/chain.h> | ||||
#include <interfaces/handler.h> | #include <interfaces/handler.h> | ||||
#include <key.h> | #include <key.h> | ||||
#include <rwcollection.h> | #include <rwcollection.h> | ||||
▲ Show 20 Lines • Show All 258 Lines • ▼ Show 20 Lines | public: | ||||
bool addNode(NodeId nodeid, const Proof &proof, | bool addNode(NodeId nodeid, const Proof &proof, | ||||
const Delegation &delegation); | const Delegation &delegation); | ||||
bool forNode(NodeId nodeid, std::function<bool(const Node &n)> func) const; | bool forNode(NodeId nodeid, std::function<bool(const Node &n)> func) const; | ||||
CPubKey getSessionPubKey() const; | CPubKey getSessionPubKey() const; | ||||
bool sendHello(CNode *pfrom) const; | bool sendHello(CNode *pfrom) const; | ||||
std::vector<avalanche::Peer> getPeers() const; | |||||
std::vector<NodeId> getNodeIdsForPeer(PeerId peerId) const; | |||||
bool startEventLoop(CScheduler &scheduler); | bool startEventLoop(CScheduler &scheduler); | ||||
bool stopEventLoop(); | bool stopEventLoop(); | ||||
private: | private: | ||||
void runEventLoop(); | void runEventLoop(); | ||||
void clearTimedoutRequests(); | void clearTimedoutRequests(); | ||||
std::vector<CInv> getInvsForNextPoll(bool forPoll = true); | std::vector<CInv> getInvsForNextPoll(bool forPoll = true); | ||||
NodeId getSuitableNodeToQuery(); | NodeId getSuitableNodeToQuery(); | ||||
Show All 12 Lines |