Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

Handles multiple sequential sessions of one specific LLMQ type. More...

#include <quorums_dkgsessionhandler.h>

+ Collaboration diagram for llmq::CDKGSessionHandler:

Public Member Functions

 CDKGSessionHandler (const Consensus::LLMQParams &_params, CBLSWorker &blsWorker, CDKGSessionManager &_dkgManager)
 
 ~CDKGSessionHandler ()
 
void UpdatedBlockTip (const CBlockIndex *pindexNew)
 
void ProcessMessage (CNode *pfrom, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
 
void StartThread ()
 
void StopThread ()
 

Private Types

typedef std::function< void()> StartPhaseFunc
 
typedef std::function< bool()> WhileWaitFunc
 

Private Member Functions

bool InitNewQuorum (const CBlockIndex *pindexQuorum)
 
std::pair< QuorumPhase, uint256GetPhaseAndQuorumHash () const
 
void WaitForNextPhase (QuorumPhase curPhase, QuorumPhase nextPhase, const uint256 &expectedQuorumHash, const WhileWaitFunc &runWhileWaiting)
 
void WaitForNewQuorum (const uint256 &oldQuorumHash)
 
void SleepBeforePhase (QuorumPhase curPhase, const uint256 &expectedQuorumHash, double randomSleepFactor, const WhileWaitFunc &runWhileWaiting)
 
void HandlePhase (QuorumPhase curPhase, QuorumPhase nextPhase, const uint256 &expectedQuorumHash, double randomSleepFactor, const StartPhaseFunc &startPhaseFunc, const WhileWaitFunc &runWhileWaiting)
 
void HandleDKGRound ()
 
void PhaseHandlerThread ()
 

Private Attributes

CCriticalSection cs
 
std::atomic< bool > stopRequested {false}
 
const Consensus::LLMQParamsparams
 
CBLSWorkerblsWorker
 
CDKGSessionManagerdkgManager
 
QuorumPhase phase {QuorumPhase_Idle}
 
int currentHeight {-1}
 
int quorumHeight {-1}
 
uint256 quorumHash
 
std::shared_ptr< CDKGSessioncurSession
 
std::thread phaseHandlerThread
 
CDKGPendingMessages pendingContributions
 
CDKGPendingMessages pendingComplaints
 
CDKGPendingMessages pendingJustifications
 
CDKGPendingMessages pendingPrematureCommitments
 

Friends

class CDKGSessionManager
 

Detailed Description

Handles multiple sequential sessions of one specific LLMQ type.

There is one instance of this class per LLMQ type.

It internally starts the phase handler thread, which constantly loops and sequentially processes one session at a time and waiting for the next phase if necessary.

Definition at line 96 of file quorums_dkgsessionhandler.h.

Member Typedef Documentation

◆ StartPhaseFunc

typedef std::function<void()> llmq::CDKGSessionHandler::StartPhaseFunc
private

Definition at line 136 of file quorums_dkgsessionhandler.h.

◆ WhileWaitFunc

typedef std::function<bool()> llmq::CDKGSessionHandler::WhileWaitFunc
private

Definition at line 137 of file quorums_dkgsessionhandler.h.

Constructor & Destructor Documentation

◆ CDKGSessionHandler()

llmq::CDKGSessionHandler::CDKGSessionHandler ( const Consensus::LLMQParams _params,
CBLSWorker blsWorker,
CDKGSessionManager _dkgManager 
)

◆ ~CDKGSessionHandler()

llmq::CDKGSessionHandler::~CDKGSessionHandler ( )

Definition at line 103 of file quorums_dkgsessionhandler.cpp.

Member Function Documentation

◆ GetPhaseAndQuorumHash()

std::pair< QuorumPhase, uint256 > llmq::CDKGSessionHandler::GetPhaseAndQuorumHash ( ) const
private

Definition at line 183 of file quorums_dkgsessionhandler.cpp.

References cs, LOCK, phase, and quorumHash.

Referenced by WaitForNewQuorum(), and WaitForNextPhase().

◆ HandleDKGRound()

◆ HandlePhase()

void llmq::CDKGSessionHandler::HandlePhase ( QuorumPhase  curPhase,
QuorumPhase  nextPhase,
const uint256 expectedQuorumHash,
double  randomSleepFactor,
const StartPhaseFunc startPhaseFunc,
const WhileWaitFunc runWhileWaiting 
)
private

◆ InitNewQuorum()

◆ PhaseHandlerThread()

◆ ProcessMessage()

◆ SleepBeforePhase()

◆ StartThread()

void llmq::CDKGSessionHandler::StartThread ( )

◆ StopThread()

void llmq::CDKGSessionHandler::StopThread ( )

Definition at line 153 of file quorums_dkgsessionhandler.cpp.

References phaseHandlerThread, and stopRequested.

◆ UpdatedBlockTip()

◆ WaitForNewQuorum()

void llmq::CDKGSessionHandler::WaitForNewQuorum ( const uint256 oldQuorumHash)
private

◆ WaitForNextPhase()

Friends And Related Function Documentation

◆ CDKGSessionManager

friend class CDKGSessionManager
friend

Definition at line 99 of file quorums_dkgsessionhandler.h.

Member Data Documentation

◆ blsWorker

CBLSWorker& llmq::CDKGSessionHandler::blsWorker
private

Definition at line 106 of file quorums_dkgsessionhandler.h.

Referenced by InitNewQuorum().

◆ cs

CCriticalSection llmq::CDKGSessionHandler::cs
mutableprivate

◆ currentHeight

int llmq::CDKGSessionHandler::currentHeight {-1}
private

Definition at line 110 of file quorums_dkgsessionhandler.h.

Referenced by SleepBeforePhase(), and UpdatedBlockTip().

◆ curSession

std::shared_ptr<CDKGSession> llmq::CDKGSessionHandler::curSession
private

Definition at line 113 of file quorums_dkgsessionhandler.h.

Referenced by HandleDKGRound(), InitNewQuorum(), and SleepBeforePhase().

◆ dkgManager

CDKGSessionManager& llmq::CDKGSessionHandler::dkgManager
private

Definition at line 107 of file quorums_dkgsessionhandler.h.

Referenced by InitNewQuorum().

◆ params

◆ pendingComplaints

CDKGPendingMessages llmq::CDKGSessionHandler::pendingComplaints
private

Definition at line 117 of file quorums_dkgsessionhandler.h.

Referenced by HandleDKGRound(), and ProcessMessage().

◆ pendingContributions

CDKGPendingMessages llmq::CDKGSessionHandler::pendingContributions
private

Definition at line 116 of file quorums_dkgsessionhandler.h.

Referenced by HandleDKGRound(), and ProcessMessage().

◆ pendingJustifications

CDKGPendingMessages llmq::CDKGSessionHandler::pendingJustifications
private

Definition at line 118 of file quorums_dkgsessionhandler.h.

Referenced by HandleDKGRound(), and ProcessMessage().

◆ pendingPrematureCommitments

CDKGPendingMessages llmq::CDKGSessionHandler::pendingPrematureCommitments
private

Definition at line 119 of file quorums_dkgsessionhandler.h.

Referenced by HandleDKGRound(), and ProcessMessage().

◆ phase

QuorumPhase llmq::CDKGSessionHandler::phase {QuorumPhase_Idle}
private

◆ phaseHandlerThread

std::thread llmq::CDKGSessionHandler::phaseHandlerThread
private

Definition at line 114 of file quorums_dkgsessionhandler.h.

Referenced by StartThread(), and StopThread().

◆ quorumHash

uint256 llmq::CDKGSessionHandler::quorumHash
private

◆ quorumHeight

int llmq::CDKGSessionHandler::quorumHeight {-1}
private

Definition at line 111 of file quorums_dkgsessionhandler.h.

Referenced by HandleDKGRound(), and UpdatedBlockTip().

◆ stopRequested

std::atomic<bool> llmq::CDKGSessionHandler::stopRequested {false}
private

The documentation for this class was generated from the following files:
Released under the MIT license