Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
quorums_dkgsessionmgr.cpp
Go to the documentation of this file.
71 void CDKGSessionManager::ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman)
95 // peek into the message and see which LLMQType it is. First byte of all messages is always the LLMQType
183 bool CDKGSessionManager::GetPrematureCommitment(const uint256& hash, CDKGPrematureCommitment& ret) const
195 if (it != dkgType.curSession->prematureCommitments.end() && dkgType.curSession->validCommitments.count(hash)) {
203 void CDKGSessionManager::WriteVerifiedVvecContribution(Consensus::LLMQType llmqType, const CBlockIndex* pindexQuorum, const uint256& proTxHash, const BLSVerificationVectorPtr& vvec)
205 llmqDb.Write(std::make_tuple(DB_VVEC, llmqType, pindexQuorum->GetBlockHash(), proTxHash), *vvec);
208 void CDKGSessionManager::WriteVerifiedSkContribution(Consensus::LLMQType llmqType, const CBlockIndex* pindexQuorum, const uint256& proTxHash, const CBLSSecretKey& skContribution)
210 llmqDb.Write(std::make_tuple(DB_SKCONTRIB, llmqType, pindexQuorum->GetBlockHash(), proTxHash), skContribution);
213 bool CDKGSessionManager::GetVerifiedContributions(Consensus::LLMQType llmqType, const CBlockIndex* pindexQuorum, const std::vector<bool>& validMembers, std::vector<uint16_t>& memberIndexesRet, std::vector<BLSVerificationVectorPtr>& vvecsRet, BLSSecretKeyVector& skContributionsRet)
227 if (!GetVerifiedContribution(llmqType, pindexQuorum, members[i]->proTxHash, vvec, skContribution)) {
239 bool CDKGSessionManager::GetVerifiedContribution(Consensus::LLMQType llmqType, const CBlockIndex* pindexQuorum, const uint256& proTxHash, BLSVerificationVectorPtr& vvecRet, CBLSSecretKey& skContributionRet)
253 if (llmqDb.Read(std::make_tuple(DB_VVEC, llmqType, pindexQuorum->GetBlockHash(), proTxHash), vvec)) {
256 llmqDb.Read(std::make_tuple(DB_SKCONTRIB, llmqType, pindexQuorum->GetBlockHash(), proTxHash), skContribution);
258 it = contributionsCache.emplace(cacheKey, ContributionsCacheEntry{GetTimeMillis(), vvecPtr, skContribution}).first;
CCriticalSection contributionsCacheCs
Definition: quorums_dkgsessionmgr.h:29
std::map< Consensus::LLMQType, CDKGSessionHandler > dkgSessionHandlers
Definition: quorums_dkgsessionmgr.h:27
Definition: bls.h:238
static const int64_t MAX_CONTRIBUTION_CACHE_TIME
Definition: quorums_dkgsessionmgr.h:21
void WriteVerifiedSkContribution(Consensus::LLMQType llmqType, const CBlockIndex *pindexQuorum, const uint256 &proTxHash, const CBLSSecretKey &skContribution)
Definition: quorums_dkgsessionmgr.cpp:208
CDKGSessionManager * quorumDKGSessionManager
Definition: quorums_dkgsessionmgr.cpp:19
Definition: bls_worker.h:21
Definition: dbwrapper.h:197
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:103
Definition: deterministicmns.h:26
bool GetVerifiedContribution(Consensus::LLMQType llmqType, const CBlockIndex *pindexQuorum, const uint256 &proTxHash, BLSVerificationVectorPtr &vvecRet, CBLSSecretKey &skContributionRet)
Definition: quorums_dkgsessionmgr.cpp:239
std::unique_ptr< CDeterministicMNManager > deterministicMNManager
Definition: deterministicmns.cpp:24
bool GetVerifiedContributions(Consensus::LLMQType llmqType, const CBlockIndex *pindexQuorum, const std::vector< bool > &validMembers, std::vector< uint16_t > &memberIndexesRet, std::vector< BLSVerificationVectorPtr > &vvecsRet, BLSSecretKeyVector &skContributionsRet)
Definition: quorums_dkgsessionmgr.cpp:213
void Misbehaving(NodeId pnode, int howmuch, const std::string &message)
Increase a node's misbehavior score.
Definition: net_processing.cpp:1024
std::shared_ptr< BLSVerificationVector > BLSVerificationVectorPtr
Definition: bls.h:471
void ProcessMessage(CNode *pfrom, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
Definition: quorums_dkgsessionmgr.cpp:71
Definition: spork.h:27
bool GetJustification(const uint256 &hash, CDKGJustification &ret) const
Definition: quorums_dkgsessionmgr.cpp:163
bool GetContribution(const uint256 &hash, CDKGContribution &ret) const
Definition: quorums_dkgsessionmgr.cpp:123
Definition: quorums_dkgsession.h:123
~CDKGSessionManager()
Definition: quorums_dkgsessionmgr.cpp:35
Definition: quorums_dkgsession.h:36
bool Write(const K &key, const V &value, bool fSync=false)
Definition: dbwrapper.h:298
bool GetPrematureCommitment(const uint256 &hash, CDKGPrematureCommitment &ret) const
Definition: quorums_dkgsessionmgr.cpp:183
void WriteVerifiedVvecContribution(Consensus::LLMQType llmqType, const CBlockIndex *pindexQuorum, const uint256 &proTxHash, const BLSVerificationVectorPtr &vvec)
Definition: quorums_dkgsessionmgr.cpp:203
void UpdatedBlockTip(const CBlockIndex *pindexNew, bool fInitialDownload)
Definition: quorums_dkgsessionmgr.cpp:53
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:170
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:947
Definition: quorums_dkgsession.h:88
CDKGSessionManager(CDBWrapper &_llmqDb, CBLSWorker &_blsWorker)
Definition: quorums_dkgsessionmgr.cpp:24
bool IsSporkActive(SporkId nSporkID)
IsSporkActive returns a bool for time-based sporks, and should be used to determine whether the spork...
Definition: spork.cpp:211
const Consensus::Params & GetConsensus() const
Definition: chainparams.h:54
std::map< ContributionsCacheKey, ContributionsCacheEntry > contributionsCache
Definition: quorums_dkgsessionmgr.h:46
bool GetComplaint(const uint256 &hash, CDKGComplaint &ret) const
Definition: quorums_dkgsessionmgr.cpp:143
bool AlreadyHave(const CInv &inv) const
Definition: quorums_dkgsessionmgr.cpp:106
static std::vector< CDeterministicMNCPtr > GetAllQuorumMembers(Consensus::LLMQType llmqType, const CBlockIndex *pindexQuorum)
Definition: quorums_utils.cpp:18