Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Acts as a FIFO queue for incoming DKG messages. More...
#include <quorums_dkgsessionhandler.h>
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< BinaryMessage > | PopPendingMessages (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< BinaryMessage > | pendingMessages |
std::map< NodeId, size_t > | messagesPerNode |
std::set< uint256 > | seenMessages |
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()
|
explicit |
Definition at line 21 of file quorums_dkgsessionhandler.cpp.
Member Function Documentation
◆ Clear()
void llmq::CDKGPendingMessages::Clear | ( | ) |
Definition at line 78 of file quorums_dkgsessionhandler.cpp.
References cs, LOCK, messagesPerNode, pendingMessages, and seenMessages.
Referenced by llmq::CDKGSessionHandler::HandleDKGRound().
◆ HasSeen()
bool llmq::CDKGPendingMessages::HasSeen | ( | const uint256 & | hash | ) | const |
Definition at line 72 of file quorums_dkgsessionhandler.cpp.
References cs, LOCK, and seenMessages.
◆ PopAndDeserializeMessages()
|
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]
void llmq::CDKGPendingMessages::PushPendingMessage | ( | NodeId | from, |
CDataStream & | vRecv | ||
) |
Definition at line 27 of file quorums_dkgsessionhandler.cpp.
References cs, cs_main, EraseObjectRequest(), CHashWriter::GetHash(), invType, BCLog::LLMQ_DKG, LOCK, LOCK2, LogPrint, maxMessagesPerNode, messagesPerNode, pendingMessages, seenMessages, SER_GETHASH, base_blob< BITS >::ToString(), and CHashWriter::write().
Referenced by llmq::CDKGSessionHandler::ProcessMessage(), PushPendingMessage(), llmq::CDKGSession::SendCommitment(), llmq::CDKGSession::SendComplaint(), llmq::CDKGSession::SendContributions(), and llmq::CDKGSession::SendJustification().
◆ PushPendingMessage() [2/2]
|
inline |
Definition at line 58 of file quorums_dkgsessionhandler.h.
References PROTOCOL_VERSION, PushPendingMessage(), and SER_NETWORK.
Member Data Documentation
◆ cs
|
mutableprivate |
Definition at line 42 of file quorums_dkgsessionhandler.h.
Referenced by Clear(), HasSeen(), PopPendingMessages(), and PushPendingMessage().
◆ invType
|
private |
Definition at line 43 of file quorums_dkgsessionhandler.h.
Referenced by PushPendingMessage().
◆ maxMessagesPerNode
|
private |
Definition at line 44 of file quorums_dkgsessionhandler.h.
Referenced by PushPendingMessage().
◆ messagesPerNode
|
private |
Definition at line 46 of file quorums_dkgsessionhandler.h.
Referenced by Clear(), and PushPendingMessage().
◆ pendingMessages
|
private |
Definition at line 45 of file quorums_dkgsessionhandler.h.
Referenced by Clear(), PopPendingMessages(), and PushPendingMessage().
◆ 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:
- src/llmq/quorums_dkgsessionhandler.h
- src/llmq/quorums_dkgsessionhandler.cpp