Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.h
Show All 18 Lines | |||||
#include <boost/multi_index_container.hpp> | #include <boost/multi_index_container.hpp> | ||||
#include <chrono> | #include <chrono> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <vector> | #include <vector> | ||||
namespace avalanche { | namespace avalanche { | ||||
class Delegation; | |||||
struct Slot { | struct Slot { | ||||
private: | private: | ||||
uint64_t start; | uint64_t start; | ||||
uint32_t score; | uint32_t score; | ||||
PeerId peerid; | PeerId peerid; | ||||
public: | public: | ||||
Slot(uint64_t startIn, uint32_t scoreIn, PeerId peeridIn) | Slot(uint64_t startIn, uint32_t scoreIn, PeerId peeridIn) | ||||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | public: | ||||
* Remove an existing peer. | * Remove an existing peer. | ||||
* This is not meant for public consumption. | * This is not meant for public consumption. | ||||
*/ | */ | ||||
bool removePeer(const PeerId peerid); | bool removePeer(const PeerId peerid); | ||||
/** | /** | ||||
* Node API. | * Node API. | ||||
*/ | */ | ||||
bool addNode(NodeId nodeid, const Proof &proof, const CPubKey &pubkey); | bool addNode(NodeId nodeid, const Proof &proof, | ||||
const Delegation &delegation); | |||||
bool removeNode(NodeId nodeid); | bool removeNode(NodeId nodeid); | ||||
NodeId selectNode(); | NodeId selectNode(); | ||||
bool forNode(NodeId nodeid, std::function<bool(const Node &n)> func) const; | bool forNode(NodeId nodeid, std::function<bool(const Node &n)> func) const; | ||||
bool updateNextRequestTime(NodeId nodeid, TimePoint timeout); | bool updateNextRequestTime(NodeId nodeid, TimePoint timeout); | ||||
/** | /** | ||||
Show All 35 Lines |