Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/peermanager.h
Show All 10 Lines | |||||
static constexpr size_t NO_PEER = ~size_t(0); | static constexpr size_t NO_PEER = ~size_t(0); | ||||
struct Slot { | struct Slot { | ||||
uint64_t start; | uint64_t start; | ||||
uint64_t stop; | uint64_t stop; | ||||
Slot(uint64_t startIn, uint64_t stopIn) : start(startIn), stop(stopIn) {} | Slot(uint64_t startIn, uint64_t stopIn) : start(startIn), stop(stopIn) {} | ||||
bool contains(uint64_t slot) const { return start <= slot && slot < stop; } | |||||
bool precedes(uint64_t slot) const { return slot >= stop; } | |||||
bool follows(uint64_t slot) const { return start > slot; } | |||||
}; | }; | ||||
class PeerManager { | class PeerManager { | ||||
std::vector<Slot> slots; | std::vector<Slot> slots; | ||||
uint64_t slotCount = 0; | uint64_t slotCount = 0; | ||||
uint64_t fragmentation = 0; | uint64_t fragmentation = 0; | ||||
public: | public: | ||||
Show All 18 Lines |