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

#include <quorums_signing.h>

Collaboration diagram for llmq::CSigningManager:
[legend]

Public Member Functions

 CSigningManager (CDBWrapper &llmqDb, bool fMemory)
 
bool AlreadyHave (const CInv &inv)
 
bool GetRecoveredSigForGetData (const uint256 &hash, CRecoveredSig &ret)
 
void ProcessMessage (CNode *pnode, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
 
void TruncateRecoveredSig (Consensus::LLMQType llmqType, const uint256 &id)
 
void RegisterRecoveredSigsListener (CRecoveredSigsListener *l)
 
void UnregisterRecoveredSigsListener (CRecoveredSigsListener *l)
 
bool AsyncSignIfMember (Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash, bool allowReSign=false)
 
bool HasRecoveredSig (Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
 
bool HasRecoveredSigForId (Consensus::LLMQType llmqType, const uint256 &id)
 
bool HasRecoveredSigForSession (const uint256 &signHash)
 
bool IsConflicting (Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
 
bool HasVotedOnId (Consensus::LLMQType llmqType, const uint256 &id)
 
bool GetVoteForId (Consensus::LLMQType llmqType, const uint256 &id, uint256 &msgHashRet)
 
std::vector< CQuorumCPtrGetActiveQuorumSet (Consensus::LLMQType llmqType, int signHeight)
 
CQuorumCPtr SelectQuorumForSigning (Consensus::LLMQType llmqType, const uint256 &selectionHash, int signHeight=-1, int signOffset=SIGN_HEIGHT_OFFSET)
 
bool VerifyRecoveredSig (Consensus::LLMQType llmqType, int signedAtHeight, const uint256 &id, const uint256 &msgHash, const CBLSSignature &sig)
 

Private Member Functions

void ProcessMessageRecoveredSig (CNode *pfrom, const CRecoveredSig &recoveredSig, CConnman &connman)
 
bool PreVerifyRecoveredSig (NodeId nodeId, const CRecoveredSig &recoveredSig, bool &retBan)
 
void CollectPendingRecoveredSigsToVerify (size_t maxUniqueSessions, std::unordered_map< NodeId, std::list< CRecoveredSig >> &retSigShares, std::unordered_map< std::pair< Consensus::LLMQType, uint256 >, CQuorumCPtr, StaticSaltedHasher > &retQuorums)
 
bool ProcessPendingRecoveredSigs (CConnman &connman)
 
void ProcessRecoveredSig (NodeId nodeId, const CRecoveredSig &recoveredSig, const CQuorumCPtr &quorum, CConnman &connman)
 
void Cleanup ()
 

Private Attributes

RecursiveMutex cs
 
CRecoveredSigsDb db
 
std::unordered_map< NodeId, std::list< CRecoveredSig > > pendingRecoveredSigs
 
FastRandomContext rnd
 
int64_t lastCleanupTime {0}
 
std::vector< CRecoveredSigsListener * > recoveredSigsListeners
 

Static Private Attributes

static const int64_t DEFAULT_MAX_RECOVERED_SIGS_AGE = 60 * 60 * 24 * 7
 
static const int SIGN_HEIGHT_OFFSET = 8
 

Friends

class CSigSharesManager
 

Detailed Description

Definition at line 105 of file quorums_signing.h.

Constructor & Destructor Documentation

◆ CSigningManager()

llmq::CSigningManager::CSigningManager ( CDBWrapper llmqDb,
bool  fMemory 
)

Definition at line 429 of file quorums_signing.cpp.

Member Function Documentation

◆ AlreadyHave()

bool llmq::CSigningManager::AlreadyHave ( const CInv inv)

Definition at line 433 of file quorums_signing.cpp.

Here is the call graph for this function:

◆ AsyncSignIfMember()

bool llmq::CSigningManager::AsyncSignIfMember ( Consensus::LLMQType  llmqType,
const uint256 id,
const uint256 msgHash,
bool  allowReSign = false 
)
Todo:
fix this by re-signing when the next block arrives, but only when that block results in a change of the quorum list and no recovered signature has been created in the mean time

Definition at line 729 of file quorums_signing.cpp.

Here is the call graph for this function:

◆ Cleanup()

void llmq::CSigningManager::Cleanup ( )
private

Definition at line 701 of file quorums_signing.cpp.

Here is the call graph for this function:

◆ CollectPendingRecoveredSigsToVerify()

void llmq::CSigningManager::CollectPendingRecoveredSigsToVerify ( size_t  maxUniqueSessions,
std::unordered_map< NodeId, std::list< CRecoveredSig >> &  retSigShares,
std::unordered_map< std::pair< Consensus::LLMQType, uint256 >, CQuorumCPtr, StaticSaltedHasher > &  retQuorums 
)
private

Definition at line 510 of file quorums_signing.cpp.

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

◆ GetActiveQuorumSet()

std::vector<CQuorumCPtr> llmq::CSigningManager::GetActiveQuorumSet ( Consensus::LLMQType  llmqType,
int  signHeight 
)

◆ GetRecoveredSigForGetData()

bool llmq::CSigningManager::GetRecoveredSigForGetData ( const uint256 hash,
CRecoveredSig ret 
)

Definition at line 441 of file quorums_signing.cpp.

Here is the call graph for this function:

◆ GetVoteForId()

bool llmq::CSigningManager::GetVoteForId ( Consensus::LLMQType  llmqType,
const uint256 id,
uint256 msgHashRet 
)

Definition at line 827 of file quorums_signing.cpp.

◆ HasRecoveredSig()

bool llmq::CSigningManager::HasRecoveredSig ( Consensus::LLMQType  llmqType,
const uint256 id,
const uint256 msgHash 
)

Definition at line 791 of file quorums_signing.cpp.

◆ HasRecoveredSigForId()

bool llmq::CSigningManager::HasRecoveredSigForId ( Consensus::LLMQType  llmqType,
const uint256 id 
)

Definition at line 796 of file quorums_signing.cpp.

◆ HasRecoveredSigForSession()

bool llmq::CSigningManager::HasRecoveredSigForSession ( const uint256 signHash)

Definition at line 801 of file quorums_signing.cpp.

◆ HasVotedOnId()

bool llmq::CSigningManager::HasVotedOnId ( Consensus::LLMQType  llmqType,
const uint256 id 
)

Definition at line 822 of file quorums_signing.cpp.

◆ IsConflicting()

bool llmq::CSigningManager::IsConflicting ( Consensus::LLMQType  llmqType,
const uint256 id,
const uint256 msgHash 
)

Definition at line 806 of file quorums_signing.cpp.

◆ PreVerifyRecoveredSig()

bool llmq::CSigningManager::PreVerifyRecoveredSig ( NodeId  nodeId,
const CRecoveredSig recoveredSig,
bool &  retBan 
)
private

Definition at line 486 of file quorums_signing.cpp.

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

◆ ProcessMessage()

void llmq::CSigningManager::ProcessMessage ( CNode pnode,
const std::string &  strCommand,
CDataStream vRecv,
CConnman connman 
)

Definition at line 453 of file quorums_signing.cpp.

Here is the call graph for this function:

◆ ProcessMessageRecoveredSig()

void llmq::CSigningManager::ProcessMessageRecoveredSig ( CNode pfrom,
const CRecoveredSig recoveredSig,
CConnman connman 
)
private

Definition at line 462 of file quorums_signing.cpp.

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

◆ ProcessPendingRecoveredSigs()

bool llmq::CSigningManager::ProcessPendingRecoveredSigs ( CConnman connman)
private

Definition at line 573 of file quorums_signing.cpp.

Here is the call graph for this function:

◆ ProcessRecoveredSig()

void llmq::CSigningManager::ProcessRecoveredSig ( NodeId  nodeId,
const CRecoveredSig recoveredSig,
const CQuorumCPtr quorum,
CConnman connman 
)
private

Definition at line 637 of file quorums_signing.cpp.

Here is the call graph for this function:

◆ RegisterRecoveredSigsListener()

void llmq::CSigningManager::RegisterRecoveredSigsListener ( CRecoveredSigsListener l)

Definition at line 716 of file quorums_signing.cpp.

◆ SelectQuorumForSigning()

CQuorumCPtr llmq::CSigningManager::SelectQuorumForSigning ( Consensus::LLMQType  llmqType,
const uint256 selectionHash,
int  signHeight = -1,
int  signOffset = SIGN_HEIGHT_OFFSET 
)

Definition at line 832 of file quorums_signing.cpp.

Here is the call graph for this function:

◆ TruncateRecoveredSig()

void llmq::CSigningManager::TruncateRecoveredSig ( Consensus::LLMQType  llmqType,
const uint256 id 
)

Definition at line 696 of file quorums_signing.cpp.

◆ UnregisterRecoveredSigsListener()

void llmq::CSigningManager::UnregisterRecoveredSigsListener ( CRecoveredSigsListener l)

Definition at line 722 of file quorums_signing.cpp.

◆ VerifyRecoveredSig()

bool llmq::CSigningManager::VerifyRecoveredSig ( Consensus::LLMQType  llmqType,
int  signedAtHeight,
const uint256 id,
const uint256 msgHash,
const CBLSSignature sig 
)

Definition at line 868 of file quorums_signing.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ CSigSharesManager

friend class CSigSharesManager
friend

Definition at line 107 of file quorums_signing.h.

Member Data Documentation

◆ cs

RecursiveMutex llmq::CSigningManager::cs
private

Definition at line 116 of file quorums_signing.h.

◆ db

CRecoveredSigsDb llmq::CSigningManager::db
private

Definition at line 118 of file quorums_signing.h.

◆ DEFAULT_MAX_RECOVERED_SIGS_AGE

const int64_t llmq::CSigningManager::DEFAULT_MAX_RECOVERED_SIGS_AGE = 60 * 60 * 24 * 7
staticprivate

Definition at line 108 of file quorums_signing.h.

◆ lastCleanupTime

int64_t llmq::CSigningManager::lastCleanupTime {0}
private

Definition at line 126 of file quorums_signing.h.

◆ pendingRecoveredSigs

std::unordered_map<NodeId, std::list<CRecoveredSig> > llmq::CSigningManager::pendingRecoveredSigs
private

Definition at line 121 of file quorums_signing.h.

◆ recoveredSigsListeners

std::vector<CRecoveredSigsListener*> llmq::CSigningManager::recoveredSigsListeners
private

Definition at line 128 of file quorums_signing.h.

◆ rnd

FastRandomContext llmq::CSigningManager::rnd
private

Definition at line 124 of file quorums_signing.h.

◆ SIGN_HEIGHT_OFFSET

const int llmq::CSigningManager::SIGN_HEIGHT_OFFSET = 8
staticprivate

Definition at line 113 of file quorums_signing.h.


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