12 #include "validation.h"
27 std::vector<CDeterministicMNCPtr> dmnMembers;
28 if (detailLevel == 2) {
30 if (pindexQuorum !=
nullptr) {
51 ArrOrCount badMembers;
52 ArrOrCount weComplain;
53 ArrOrCount receivedContributions;
54 ArrOrCount receivedComplaints;
55 ArrOrCount receivedJustifications;
56 ArrOrCount receivedPrematureCommitments;
57 ArrOrCount complaintsFromMembers;
59 auto add = [&](ArrOrCount& v,
size_t idx,
bool flag) {
61 if (detailLevel == 0) {
63 }
else if (detailLevel == 1) {
64 v.arr.push_back((
int)idx);
65 }
else if (detailLevel == 2) {
67 a.
pushKV(
"memberIndex", (
int)idx);
68 if (idx < dmnMembers.size()) {
75 auto push = [&](ArrOrCount& v,
const std::string&
name) {
76 if (detailLevel == 0) {
83 for (
size_t i = 0; i <
members.size(); i++) {
85 add(badMembers, i, m.bad);
86 add(weComplain, i, m.weComplain);
87 add(receivedContributions, i, m.receivedContribution);
88 add(receivedComplaints, i, m.receivedComplaint);
89 add(receivedJustifications, i, m.receivedJustification);
90 add(receivedPrematureCommitments, i, m.receivedPrematureCommitment);
92 push(badMembers,
"badMembers");
93 push(weComplain,
"weComplain");
94 push(receivedContributions,
"receivedContributions");
95 push(receivedComplaints,
"receivedComplaints");
96 push(receivedJustifications,
"receivedJustifications");
97 push(receivedPrematureCommitments,
"receivedPrematureCommitments");
100 if (detailLevel == 2) {
102 for (
const auto& dmn : dmnMembers) {
103 arr.
push_back(dmn->proTxHash.ToString());
105 ret.
pushKV(
"allMembers", arr);
121 if (opt_params == nullopt) {
124 sessionsJson.
pushKV(opt_params->name, p.second.ToJson(detailLevel));
126 ret.
pushKV(
"session", sessionsJson);
160 auto& session = it->second;
161 session.llmqType = llmqType;
162 session.quorumHash = quorumHash;
163 session.quorumHeight = (uint32_t)quorumHeight;
165 session.statusBitset = 0;
166 session.members.clear();
167 session.members.resize((
size_t)params.size);
179 if (func(it->second)) {
193 if (func(it->second.members.at(memberIdx))) {
const CChainParams & Params()
Return the currently selected parameters.
The block chain is a tree shaped structure starting with the genesis block at the root,...
const Consensus::Params & GetConsensus() const
bool push_back(const UniValue &val)
bool pushKV(const std::string &key, const UniValue &val)
std::string ToString() const
void GetLocalDebugStatus(CDKGDebugStatus &ret)
void InitLocalSessionStatus(Consensus::LLMQType llmqType, const uint256 &quorumHash, int quorumHeight)
void UpdateLocalSessionStatus(Consensus::LLMQType llmqType, std::function< bool(CDKGDebugSessionStatus &status)> &&func)
CDKGDebugStatus localStatus
void ResetLocalSessionStatus(Consensus::LLMQType llmqType)
void UpdateLocalMemberStatus(Consensus::LLMQType llmqType, size_t memberIdx, std::function< bool(CDKGDebugMemberStatus &status)> &&func)
std::vector< CDKGDebugMemberStatus > members
bool receivedFinalCommitment
bool sentPrematureCommitment
UniValue ToJson(int detailLevel) const
Consensus::LLMQType llmqType
UniValue ToJson(int detailLevel) const
std::map< Consensus::LLMQType, CDKGDebugSessionStatus > sessions
std::unique_ptr< CDeterministicMNManager > deterministicMNManager
std::unique_ptr< CDKGDebugManager > quorumDKGDebugManager
RecursiveMutex cs_main
Global state.
boost::optional< T > Optional
Substitute for C++17 std::optional.
Parameters that influence chain consensus.
Optional< LLMQParams > GetLLMQParams(uint8_t llmqtype) const
std::map< LLMQType, LLMQParams > llmqs
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
int64_t GetAdjustedTime()
std::string FormatISO8601DateTime(int64_t nTime)
ISO 8601 formatting is preferred.
CBlockIndex * LookupBlockIndex(const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)