Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

llmq::CDKGPendingMessages Class Reference

Acts as a FIFO queue for incoming DKG messages. More...

#include <quorums_dkgsessionhandler.h>

+ Collaboration diagram for llmq::CDKGPendingMessages:

Public Types

typedef std::pair< NodeId, std::shared_ptr< CDataStream > > BinaryMessage
 

Public Member Functions

 CDKGPendingMessages (size_t _maxMessagesPerNode, int _invType)
 
void PushPendingMessage (NodeId from, CDataStream &vRecv)
 
std::list< BinaryMessagePopPendingMessages (size_t maxCount)
 
bool HasSeen (const uint256 &hash) const
 
void Clear ()
 
template<typename Message >
void PushPendingMessage (NodeId from, Message &msg)
 
template<typename Message >
std::vector< std::pair< NodeId, std::shared_ptr< Message > > > PopAndDeserializeMessages (size_t maxCount)
 

Private Attributes

CCriticalSection cs
 
int invType
 
size_t maxMessagesPerNode
 
std::list< BinaryMessagependingMessages
 
std::map< NodeId, size_t > messagesPerNode
 
std::set< uint256seenMessages
 

Detailed Description

Acts as a FIFO queue for incoming DKG messages.

The reason we need this is that deserialization of these messages is too slow to be processed in the main message handler thread. So, instead of processing them directly from the main handler thread, we push them into a CDKGPendingMessages object and later pop+deserialize them in the DKG phase handler thread.

Each message type has it's own instance of this class.

Definition at line 36 of file quorums_dkgsessionhandler.h.

Member Typedef Documentation

◆ BinaryMessage

typedef std::pair<NodeId, std::shared_ptr<CDataStream> > llmq::CDKGPendingMessages::BinaryMessage

Definition at line 39 of file quorums_dkgsessionhandler.h.

Constructor & Destructor Documentation

◆ CDKGPendingMessages()

llmq::CDKGPendingMessages::CDKGPendingMessages ( size_t  _maxMessagesPerNode,
int  _invType 
)
explicit

Definition at line 21 of file quorums_dkgsessionhandler.cpp.

Member Function Documentation

◆ Clear()

void llmq::CDKGPendingMessages::Clear ( )

◆ HasSeen()

bool llmq::CDKGPendingMessages::HasSeen ( const uint256 hash) const

Definition at line 72 of file quorums_dkgsessionhandler.cpp.

References cs, LOCK, and seenMessages.

◆ PopAndDeserializeMessages()

template<typename Message >
std::vector<std::pair<NodeId, std::shared_ptr<Message> > > llmq::CDKGPendingMessages::PopAndDeserializeMessages ( size_t  maxCount)
inline

Definition at line 67 of file quorums_dkgsessionhandler.h.

References PopPendingMessages().

Referenced by llmq::ProcessPendingMessageBatch().

◆ PopPendingMessages()

std::list< CDKGPendingMessages::BinaryMessage > llmq::CDKGPendingMessages::PopPendingMessages ( size_t  maxCount)

Definition at line 59 of file quorums_dkgsessionhandler.cpp.

References cs, LOCK, and pendingMessages.

Referenced by PopAndDeserializeMessages().

◆ PushPendingMessage() [1/2]

◆ PushPendingMessage() [2/2]

template<typename Message >
void llmq::CDKGPendingMessages::PushPendingMessage ( NodeId  from,
Message &  msg 
)
inline

Definition at line 58 of file quorums_dkgsessionhandler.h.

References PROTOCOL_VERSION, PushPendingMessage(), and SER_NETWORK.

Member Data Documentation

◆ cs

CCriticalSection llmq::CDKGPendingMessages::cs
mutableprivate

Definition at line 42 of file quorums_dkgsessionhandler.h.

Referenced by Clear(), HasSeen(), PopPendingMessages(), and PushPendingMessage().

◆ invType

int llmq::CDKGPendingMessages::invType
private

Definition at line 43 of file quorums_dkgsessionhandler.h.

Referenced by PushPendingMessage().

◆ maxMessagesPerNode

size_t llmq::CDKGPendingMessages::maxMessagesPerNode
private

Definition at line 44 of file quorums_dkgsessionhandler.h.

Referenced by PushPendingMessage().

◆ messagesPerNode

std::map<NodeId, size_t> llmq::CDKGPendingMessages::messagesPerNode
private

Definition at line 46 of file quorums_dkgsessionhandler.h.

Referenced by Clear(), and PushPendingMessage().

◆ pendingMessages

std::list<BinaryMessage> llmq::CDKGPendingMessages::pendingMessages
private

Definition at line 45 of file quorums_dkgsessionhandler.h.

Referenced by Clear(), PopPendingMessages(), and PushPendingMessage().

◆ seenMessages

std::set<uint256> llmq::CDKGPendingMessages::seenMessages
private

Definition at line 47 of file quorums_dkgsessionhandler.h.

Referenced by Clear(), HasSeen(), and PushPendingMessage().


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