Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.h
Show All 21 Lines | |||||
#include <boost/multi_index_container.hpp> | #include <boost/multi_index_container.hpp> | ||||
#include <atomic> | #include <atomic> | ||||
#include <chrono> | #include <chrono> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <memory> | #include <memory> | ||||
#include <vector> | #include <vector> | ||||
class ArgsManager; | |||||
class Config; | class Config; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class CScheduler; | class CScheduler; | ||||
class PeerManager; | class PeerManager; | ||||
struct bilingual_str; | |||||
using NodePeerManager = 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; | ||||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | class Processor { | ||||
std::unique_ptr<interfaces::Handler> chainNotificationsHandler; | std::unique_ptr<interfaces::Handler> chainNotificationsHandler; | ||||
/** | /** | ||||
* Flag indicating that the proof must be registered at first new block | * Flag indicating that the proof must be registered at first new block | ||||
* after IBD | * after IBD | ||||
*/ | */ | ||||
bool mustRegisterProof = false; | bool mustRegisterProof = false; | ||||
public: | |||||
Processor(interfaces::Chain &chain, CConnman *connmanIn, | Processor(interfaces::Chain &chain, CConnman *connmanIn, | ||||
NodePeerManager *nodePeerManagerIn); | NodePeerManager *nodePeerManagerIn, | ||||
std::unique_ptr<PeerData> peerDataIn, CKey sessionKeyIn); | |||||
public: | |||||
~Processor(); | ~Processor(); | ||||
static std::unique_ptr<Processor> | |||||
MakeProcessor(const ArgsManager &argsman, interfaces::Chain &chain, | |||||
CConnman *connman, NodePeerManager *nodePeerManager, | |||||
bilingual_str &error); | |||||
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; | ||||
int getConfidence(const CBlockIndex *pindex) const; | int getConfidence(const CBlockIndex *pindex) const; | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |