Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.h
Show All 23 Lines | |||||
#include <chrono> | #include <chrono> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <memory> | #include <memory> | ||||
#include <vector> | #include <vector> | ||||
class Config; | class Config; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class CScheduler; | class CScheduler; | ||||
class PeerManager; | |||||
using NodePeerManager = PeerManager; | |||||
/** | /** | ||||
* Is avalanche enabled by default. | * Is avalanche enabled by default. | ||||
*/ | */ | ||||
static constexpr bool AVALANCHE_DEFAULT_ENABLED = false; | static constexpr bool AVALANCHE_DEFAULT_ENABLED = false; | ||||
/** | /** | ||||
* Finalization score. | * Finalization score. | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | |||||
struct query_timeout {}; | struct query_timeout {}; | ||||
namespace { | namespace { | ||||
struct AvalancheTest; | struct AvalancheTest; | ||||
} | } | ||||
class Processor { | class Processor { | ||||
CConnman *connman; | CConnman *connman; | ||||
NodePeerManager *nodePeerManager; | |||||
std::chrono::milliseconds queryTimeoutDuration; | std::chrono::milliseconds queryTimeoutDuration; | ||||
/** | /** | ||||
* Blocks to run avalanche on. | * Blocks to run avalanche on. | ||||
*/ | */ | ||||
RWCollection<BlockVoteMap> vote_records; | RWCollection<BlockVoteMap> vote_records; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | class Processor { | ||||
/** Event loop machinery. */ | /** Event loop machinery. */ | ||||
EventLoop eventLoop; | EventLoop eventLoop; | ||||
/** Registered interfaces::Chain::Notifications handler. */ | /** Registered interfaces::Chain::Notifications handler. */ | ||||
class NotificationsHandler; | class NotificationsHandler; | ||||
std::unique_ptr<interfaces::Handler> chainNotificationsHandler; | std::unique_ptr<interfaces::Handler> chainNotificationsHandler; | ||||
public: | public: | ||||
Processor(interfaces::Chain &chain, CConnman *connmanIn); | Processor(interfaces::Chain &chain, CConnman *connmanIn, | ||||
NodePeerManager *nodePeerManagerIn); | |||||
~Processor(); | ~Processor(); | ||||
void setQueryTimeoutDuration(std::chrono::milliseconds d) { | void setQueryTimeoutDuration(std::chrono::milliseconds d) { | ||||
queryTimeoutDuration = d; | queryTimeoutDuration = d; | ||||
} | } | ||||
bool addBlockToReconcile(const CBlockIndex *pindex); | bool addBlockToReconcile(const CBlockIndex *pindex); | ||||
bool isAccepted(const CBlockIndex *pindex) const; | bool isAccepted(const CBlockIndex *pindex) const; | ||||
Show All 34 Lines |