PIVX Core  5.6.99
P2P Digital Currency
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
llmq::CDKGSessionHandler Class Reference

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

#include <quorums_dkgsessionhandler.h>

Collaboration diagram for llmq::CDKGSessionHandler:
[legend]

Classes

struct  QuorumPhaseAndHash
 

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)
 
void StartThread ()
 
void StopThread ()
 

Private Types

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

Private Member Functions

bool InitNewQuorum (const CBlockIndex *pindexQuorum)
 
QuorumPhaseAndHash GetPhaseAndQuorumHash () 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

RecursiveMutex cs
 
std::atomic< bool > stopRequested {false}
 
const Consensus::LLMQParamsparams
 
CBLSWorkerblsWorker
 
CDKGSessionManagerdkgManager
 
QuorumPhase phase {QuorumPhase_Idle}
 
int currentHeight {-1}
 
int quorumHeight {-1}
 
uint256 quorumHash {UINT256_ZERO}
 
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 94 of file quorums_dkgsessionhandler.h.

Member Typedef Documentation

◆ StartPhaseFunc

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

Definition at line 137 of file quorums_dkgsessionhandler.h.

◆ WhileWaitFunc

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

Definition at line 138 of file quorums_dkgsessionhandler.h.

Constructor & Destructor Documentation

◆ CDKGSessionHandler()

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

Definition at line 87 of file quorums_dkgsessionhandler.cpp.

◆ ~CDKGSessionHandler()

llmq::CDKGSessionHandler::~CDKGSessionHandler ( )

Definition at line 102 of file quorums_dkgsessionhandler.cpp.

Member Function Documentation

◆ GetPhaseAndQuorumHash()

CDKGSessionHandler::QuorumPhaseAndHash llmq::CDKGSessionHandler::GetPhaseAndQuorumHash ( ) const
private

Definition at line 181 of file quorums_dkgsessionhandler.cpp.

Here is the caller graph for this function:

◆ HandleDKGRound()

void llmq::CDKGSessionHandler::HandleDKGRound ( )
private

Definition at line 500 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandlePhase()

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

Definition at line 318 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:

◆ InitNewQuorum()

bool llmq::CDKGSessionHandler::InitNewQuorum ( const CBlockIndex pindexQuorum)
private

Definition at line 162 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:

◆ PhaseHandlerThread()

void llmq::CDKGSessionHandler::PhaseHandlerThread ( )
private

Definition at line 583 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessMessage()

void llmq::CDKGSessionHandler::ProcessMessage ( CNode pfrom,
const std::string &  strCommand,
CDataStream vRecv 
)

Definition at line 130 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:

◆ SleepBeforePhase()

void llmq::CDKGSessionHandler::SleepBeforePhase ( QuorumPhase  curPhase,
const uint256 expectedQuorumHash,
double  randomSleepFactor,
const WhileWaitFunc runWhileWaiting 
)
private

Definition at line 250 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartThread()

void llmq::CDKGSessionHandler::StartThread ( )

Definition at line 144 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:

◆ StopThread()

void llmq::CDKGSessionHandler::StopThread ( )

Definition at line 154 of file quorums_dkgsessionhandler.cpp.

◆ UpdatedBlockTip()

void llmq::CDKGSessionHandler::UpdatedBlockTip ( const CBlockIndex pindexNew)

Definition at line 106 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:

◆ WaitForNewQuorum()

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

Definition at line 231 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:

◆ WaitForNextPhase()

void llmq::CDKGSessionHandler::WaitForNextPhase ( QuorumPhase  curPhase,
QuorumPhase  nextPhase,
const uint256 expectedQuorumHash,
const WhileWaitFunc runWhileWaiting 
)
private

Definition at line 190 of file quorums_dkgsessionhandler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ CDKGSessionManager

friend class CDKGSessionManager
friend

Definition at line 97 of file quorums_dkgsessionhandler.h.

Member Data Documentation

◆ blsWorker

CBLSWorker& llmq::CDKGSessionHandler::blsWorker
private

Definition at line 103 of file quorums_dkgsessionhandler.h.

◆ cs

RecursiveMutex llmq::CDKGSessionHandler::cs
mutableprivate

Definition at line 99 of file quorums_dkgsessionhandler.h.

◆ currentHeight

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

Definition at line 107 of file quorums_dkgsessionhandler.h.

◆ curSession

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

Definition at line 110 of file quorums_dkgsessionhandler.h.

◆ dkgManager

CDKGSessionManager& llmq::CDKGSessionHandler::dkgManager
private

Definition at line 104 of file quorums_dkgsessionhandler.h.

◆ params

const Consensus::LLMQParams& llmq::CDKGSessionHandler::params
private

Definition at line 102 of file quorums_dkgsessionhandler.h.

◆ pendingComplaints

CDKGPendingMessages llmq::CDKGSessionHandler::pendingComplaints
private

Definition at line 114 of file quorums_dkgsessionhandler.h.

◆ pendingContributions

CDKGPendingMessages llmq::CDKGSessionHandler::pendingContributions
private

Definition at line 113 of file quorums_dkgsessionhandler.h.

◆ pendingJustifications

CDKGPendingMessages llmq::CDKGSessionHandler::pendingJustifications
private

Definition at line 115 of file quorums_dkgsessionhandler.h.

◆ pendingPrematureCommitments

CDKGPendingMessages llmq::CDKGSessionHandler::pendingPrematureCommitments
private

Definition at line 116 of file quorums_dkgsessionhandler.h.

◆ phase

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

Definition at line 106 of file quorums_dkgsessionhandler.h.

◆ phaseHandlerThread

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

Definition at line 111 of file quorums_dkgsessionhandler.h.

◆ quorumHash

uint256 llmq::CDKGSessionHandler::quorumHash {UINT256_ZERO}
private

Definition at line 109 of file quorums_dkgsessionhandler.h.

◆ quorumHeight

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

Definition at line 108 of file quorums_dkgsessionhandler.h.

◆ stopRequested

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

Definition at line 100 of file quorums_dkgsessionhandler.h.


The documentation for this class was generated from the following files: