Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

quorums_debug.h
Go to the documentation of this file.
1 // Copyright (c) 2018-2019 The Dash Core developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef DASH_QUORUMS_DEBUG_H
6 #define DASH_QUORUMS_DEBUG_H
7 
8 #include <consensus/params.h>
9 #include <sync.h>
10 #include <univalue.h>
11 
12 #include <functional>
13 #include <set>
14 
15 class CDataStream;
16 class CInv;
17 class CScheduler;
18 
19 namespace llmq
20 {
21 
23 {
24 public:
25  union {
26  struct
27  {
28  // is it locally considered as bad (and thus removed from the validMembers set)
29  bool bad : 1;
30  // did we complain about this member
31  bool weComplain : 1;
32 
33  // received message for DKG phases
38  };
39  uint8_t statusBitset;
40  };
41 
42  std::set<uint16_t> complaintsFromMembers;
43 
44 public:
46 };
47 
49 {
50 public:
53  uint32_t quorumHeight{0};
54  uint8_t phase{0};
55 
56  union {
57  struct
58  {
59  // sent messages for DKG phases
61  bool sentComplaint : 1;
64 
65  bool aborted : 1;
66  };
67  uint8_t statusBitset;
68  };
69 
70  std::vector<CDKGDebugMemberStatus> members;
71 
72 public:
74 
75  UniValue ToJson(int detailLevel) const;
76 };
77 
79 {
80 public:
81  int64_t nTime{0};
82 
83  std::map<Consensus::LLMQType, CDKGDebugSessionStatus> sessions;
84 
85 public:
86  UniValue ToJson(int detailLevel) const;
87 };
88 
90 {
91 private:
94 
95 public:
97 
99 
101  void InitLocalSessionStatus(Consensus::LLMQType llmqType, const uint256& quorumHash, int quorumHeight);
102 
103  void UpdateLocalSessionStatus(Consensus::LLMQType llmqType, std::function<bool(CDKGDebugSessionStatus& status)>&& func);
104  void UpdateLocalMemberStatus(Consensus::LLMQType llmqType, size_t memberIdx, std::function<bool(CDKGDebugMemberStatus& status)>&& func);
105 };
106 
108 
109 } // namespace llmq
110 
111 #endif //DASH_QUORUMS_DEBUG_H
std::map< Consensus::LLMQType, CDKGDebugSessionStatus > sessions
Definition: quorums_debug.h:83
void InitLocalSessionStatus(Consensus::LLMQType llmqType, const uint256 &quorumHash, int quorumHeight)
void UpdateLocalSessionStatus(Consensus::LLMQType llmqType, std::function< bool(CDKGDebugSessionStatus &status)> &&func)
UniValue ToJson(int detailLevel) const
inv message data
Definition: protocol.h:429
std::set< uint16_t > complaintsFromMembers
Definition: quorums_debug.h:42
void ResetLocalSessionStatus(Consensus::LLMQType llmqType)
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:103
CCriticalSection cs
Definition: quorums_debug.h:92
void UpdateLocalMemberStatus(Consensus::LLMQType llmqType, size_t memberIdx, std::function< bool(CDKGDebugMemberStatus &status)> &&func)
LLMQType
Definition: params.h:48
UniValue ToJson(int detailLevel) const
CDKGDebugStatus localStatus
Definition: quorums_debug.h:93
Consensus::LLMQType llmqType
Definition: quorums_debug.h:51
void GetLocalDebugStatus(CDKGDebugStatus &ret)
CDKGDebugManager * quorumDKGDebugManager
256-bit opaque blob.
Definition: uint256.h:123
std::vector< CDKGDebugMemberStatus > members
Definition: quorums_debug.h:70
Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the re...
Definition: sync.h:94
Released under the MIT license