Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <governance.h>
Classes | |
struct | last_object_rec |
class | ScopedLockBool |
Public Types | |
typedef std::map< uint256, CGovernanceObject > | object_m_t |
typedef object_m_t::iterator | object_m_it |
typedef object_m_t::const_iterator | object_m_cit |
typedef CacheMap< uint256, CGovernanceObject * > | object_ref_cm_t |
typedef std::map< uint256, CGovernanceVote > | vote_m_t |
typedef vote_m_t::iterator | vote_m_it |
typedef vote_m_t::const_iterator | vote_m_cit |
typedef CacheMap< uint256, CGovernanceVote > | vote_cm_t |
typedef CacheMultiMap< uint256, vote_time_pair_t > | vote_cmm_t |
typedef object_m_t::size_type | size_type |
typedef std::map< COutPoint, last_object_rec > | txout_m_t |
typedef txout_m_t::iterator | txout_m_it |
typedef std::set< uint256 > | hash_s_t |
typedef hash_s_t::iterator | hash_s_it |
typedef hash_s_t::const_iterator | hash_s_cit |
typedef std::map< uint256, object_info_pair_t > | object_info_m_t |
typedef object_info_m_t::iterator | object_info_m_it |
typedef std::map< uint256, int64_t > | hash_time_m_t |
typedef hash_time_m_t::iterator | hash_time_m_it |
Public Member Functions | |
CGovernanceManager () | |
virtual | ~CGovernanceManager () |
bool | ConfirmInventoryRequest (const CInv &inv) |
This is called by AlreadyHave in net_processing.cpp as part of the inventory retrieval process. More... | |
void | SyncSingleObjVotes (CNode *pnode, const uint256 &nProp, const CBloomFilter &filter, CConnman &connman) |
void | SyncObjects (CNode *pnode, CConnman &connman) const |
void | ProcessMessage (CNode *pfrom, const std::string &strCommand, CDataStream &vRecv, CConnman &connman) |
void | DoMaintenance (CConnman &connman) |
CGovernanceObject * | FindGovernanceObject (const uint256 &nHash) |
std::vector< CGovernanceVote > | GetCurrentVotes (const uint256 &nParentHash, const COutPoint &mnCollateralOutpointFilter) const |
std::vector< const CGovernanceObject * > | GetAllNewerThan (int64_t nMoreThanTime) const |
void | AddGovernanceObject (CGovernanceObject &govobj, CConnman &connman, CNode *pfrom=nullptr) |
void | UpdateCachesAndClean () |
void | CheckAndRemove () |
void | Clear () |
std::string | ToString () const |
UniValue | ToJson () const |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action) |
void | UpdatedBlockTip (const CBlockIndex *pindex, CConnman &connman) |
int64_t | GetLastDiffTime () const |
void | UpdateLastDiffTime (int64_t nTimeIn) |
int | GetCachedBlockHeight () const |
bool | HaveObjectForHash (const uint256 &nHash) const |
bool | HaveVoteForHash (const uint256 &nHash) const |
int | GetVoteCount () const |
bool | SerializeObjectForHash (const uint256 &nHash, CDataStream &ss) const |
bool | SerializeVoteForHash (const uint256 &nHash, CDataStream &ss) const |
void | AddPostponedObject (const CGovernanceObject &govobj) |
void | MasternodeRateUpdate (const CGovernanceObject &govobj) |
bool | MasternodeRateCheck (const CGovernanceObject &govobj, bool fUpdateFailStatus=false) |
bool | MasternodeRateCheck (const CGovernanceObject &govobj, bool fUpdateFailStatus, bool fForce, bool &fRateCheckBypassed) |
bool | ProcessVoteAndRelay (const CGovernanceVote &vote, CGovernanceException &exception, CConnman &connman) |
void | CheckPostponedObjects (CConnman &connman) |
bool | AreRateChecksEnabled () const |
void | InitOnLoad () |
int | RequestGovernanceObjectVotes (CNode *pnode, CConnman &connman) |
int | RequestGovernanceObjectVotes (const std::vector< CNode *> &vNodesCopy, CConnman &connman) |
Public Attributes | |
CCriticalSection | cs |
ADD_SERIALIZE_METHODS | |
Private Member Functions | |
void | RequestGovernanceObject (CNode *pfrom, const uint256 &nHash, CConnman &connman, bool fUseFilter=false) |
void | AddInvalidVote (const CGovernanceVote &vote) |
bool | ProcessVote (CNode *pfrom, const CGovernanceVote &vote, CGovernanceException &exception, CConnman &connman) |
bool | AcceptObjectMessage (const uint256 &nHash) |
Called to indicate a requested object has been received. More... | |
bool | AcceptVoteMessage (const uint256 &nHash) |
Called to indicate a requested vote has been received. More... | |
void | CheckOrphanVotes (CGovernanceObject &govobj, CGovernanceException &exception, CConnman &connman) |
void | RebuildIndexes () |
void | AddCachedTriggers () |
void | RequestOrphanObjects (CConnman &connman) |
void | CleanOrphanObjects () |
void | RemoveInvalidVotes () |
Static Private Member Functions | |
static bool | AcceptMessage (const uint256 &nHash, hash_s_t &setHash) |
Static Private Attributes | |
static const int | MAX_CACHE_SIZE = 1000000 |
static const std::string | SERIALIZATION_VERSION_STRING = "CGovernanceManager-Version-15" |
static const int | MAX_TIME_FUTURE_DEVIATION = 60 * 60 |
static const int | RELIABLE_PROPAGATION_TIME = 60 |
Friends | |
class | CGovernanceObject |
Detailed Description
Definition at line 151 of file governance.h.
Member Typedef Documentation
◆ hash_s_cit
typedef hash_s_t::const_iterator CGovernanceManager::hash_s_cit |
Definition at line 205 of file governance.h.
◆ hash_s_it
typedef hash_s_t::iterator CGovernanceManager::hash_s_it |
Definition at line 203 of file governance.h.
◆ hash_s_t
typedef std::set<uint256> CGovernanceManager::hash_s_t |
Definition at line 201 of file governance.h.
◆ hash_time_m_it
typedef hash_time_m_t::iterator CGovernanceManager::hash_time_m_it |
Definition at line 213 of file governance.h.
◆ hash_time_m_t
typedef std::map<uint256, int64_t> CGovernanceManager::hash_time_m_t |
Definition at line 211 of file governance.h.
◆ object_info_m_it
typedef object_info_m_t::iterator CGovernanceManager::object_info_m_it |
Definition at line 209 of file governance.h.
◆ object_info_m_t
typedef std::map<uint256, object_info_pair_t> CGovernanceManager::object_info_m_t |
Definition at line 207 of file governance.h.
◆ object_m_cit
typedef object_m_t::const_iterator CGovernanceManager::object_m_cit |
Definition at line 181 of file governance.h.
◆ object_m_it
typedef object_m_t::iterator CGovernanceManager::object_m_it |
Definition at line 179 of file governance.h.
◆ object_m_t
typedef std::map<uint256, CGovernanceObject> CGovernanceManager::object_m_t |
Definition at line 177 of file governance.h.
◆ object_ref_cm_t
Definition at line 183 of file governance.h.
◆ size_type
typedef object_m_t::size_type CGovernanceManager::size_type |
Definition at line 195 of file governance.h.
◆ txout_m_it
typedef txout_m_t::iterator CGovernanceManager::txout_m_it |
Definition at line 199 of file governance.h.
◆ txout_m_t
typedef std::map<COutPoint, last_object_rec> CGovernanceManager::txout_m_t |
Definition at line 197 of file governance.h.
◆ vote_cm_t
Definition at line 191 of file governance.h.
◆ vote_cmm_t
Definition at line 193 of file governance.h.
◆ vote_m_cit
typedef vote_m_t::const_iterator CGovernanceManager::vote_m_cit |
Definition at line 189 of file governance.h.
◆ vote_m_it
typedef vote_m_t::iterator CGovernanceManager::vote_m_it |
Definition at line 187 of file governance.h.
◆ vote_m_t
typedef std::map<uint256, CGovernanceVote> CGovernanceManager::vote_m_t |
Definition at line 185 of file governance.h.
Constructor & Destructor Documentation
◆ CGovernanceManager()
CGovernanceManager::CGovernanceManager | ( | ) |
Definition at line 31 of file governance.cpp.
◆ ~CGovernanceManager()
|
inlinevirtual |
Definition at line 282 of file governance.h.
Member Function Documentation
◆ AcceptMessage()
Definition at line 1085 of file governance.cpp.
Referenced by AcceptObjectMessage(), and AcceptVoteMessage().
◆ AcceptObjectMessage()
|
private |
Called to indicate a requested object has been received.
Definition at line 1073 of file governance.cpp.
References AcceptMessage(), cs, LOCK, and setRequestedObjects.
Referenced by ProcessMessage().
◆ AcceptVoteMessage()
|
private |
Called to indicate a requested vote has been received.
Definition at line 1079 of file governance.cpp.
References AcceptMessage(), cs, LOCK, and setRequestedVotes.
Referenced by ProcessMessage().
◆ AddCachedTriggers()
|
private |
Definition at line 1111 of file governance.cpp.
References CGovernanceTriggerManager::AddNewTrigger(), cs, GetAdjustedTime(), CGovernanceObject::GetHash(), CGovernanceObject::GetObjectType(), GOVERNANCE_OBJECT_TRIGGER, LOCK, mapObjects, CGovernanceObject::PrepareDeletion(), and triggerman.
Referenced by InitOnLoad().
◆ AddGovernanceObject()
void CGovernanceManager::AddGovernanceObject | ( | CGovernanceObject & | govobj, |
CConnman & | connman, | ||
CNode * | pfrom = nullptr |
||
) |
Definition at line 291 of file governance.cpp.
References CGovernanceTriggerManager::AddNewTrigger(), CMasternodeSync::BumpAssetLastTime(), CheckOrphanVotes(), cs, cs_main, GetAdjustedTime(), CGovernanceObject::GetDataAsPlainString(), CGovernanceObject::GetHash(), CNode::GetLogString(), GetMainSignals(), CGovernanceObject::GetObjectType(), BCLog::GOBJECT, GOVERNANCE_OBJECT_TRIGGER, CGovernanceObject::IsValidLocally(), LOCK2, LogPrint, LogPrintf, mapObjects, MasternodeRateUpdate(), masternodeSync, nCachedBlockHeight, CMainSignals::NotifyGovernanceObject(), CGovernanceObject::Relay(), base_blob< BITS >::ToString(), triggerman, and CGovernanceObject::UpdateSentinelVariables().
Referenced by CheckPostponedObjects(), gobject_submit(), and ProcessMessage().
◆ AddInvalidVote()
|
inlineprivate |
Definition at line 406 of file governance.h.
References cmapInvalidVotes, CGovernanceVote::GetHash(), and CacheMap< K, V, Size >::Insert().
Referenced by CGovernanceObject::ProcessVote().
◆ AddPostponedObject()
|
inline |
Definition at line 369 of file governance.h.
References cs, CGovernanceObject::GetHash(), LOCK, and mapPostponedObjects.
Referenced by gobject_submit(), and ProcessMessage().
◆ AreRateChecksEnabled()
|
inline |
Definition at line 392 of file governance.h.
References cs, fRateChecksEnabled, and LOCK.
Referenced by CGovernanceObject::ProcessVote().
◆ CheckAndRemove()
|
inline |
Definition at line 308 of file governance.h.
References UpdateCachesAndClean().
◆ CheckOrphanVotes()
|
private |
Definition at line 266 of file governance.cpp.
References cmmapOrphanVotes, cs, CacheMultiMap< K, V, Size >::Erase(), fRateChecksEnabled, GetAdjustedTime(), CacheMultiMap< K, V, Size >::GetAll(), CGovernanceObject::GetHash(), CGovernanceObject::ProcessVote(), and CGovernanceVote::Relay().
Referenced by AddGovernanceObject().
◆ CheckPostponedObjects()
void CGovernanceManager::CheckPostponedObjects | ( | CConnman & | connman | ) |
Definition at line 857 of file governance.cpp.
References AddGovernanceObject(), cs, cs_main, GetAdjustedTime(), CChainParams::GetConsensus(), CGovernanceObject::GetCreationTime(), CGovernanceObject::GetHash(), CGovernanceObject::GetObjectType(), BCLog::GOBJECT, GOVERNANCE_OBJECT_TRIGGER, CGovernanceObject::IsCollateralValid(), CMasternodeSync::IsSynced(), CGovernanceObject::IsValidLocally(), LOCK2, LogPrint, LogPrintf, mapObjects, mapPostponedObjects, masternodeSync, MAX_TIME_FUTURE_DEVIATION, Consensus::Params::nPowTargetSpacing, Consensus::Params::nSuperblockCycle, Params(), CGovernanceObject::Relay(), RELIABLE_PROPAGATION_TIME, setAdditionalRelayObjects, and base_blob< BITS >::ToString().
Referenced by UpdatedBlockTip().
◆ CleanOrphanObjects()
|
private |
Definition at line 1251 of file governance.cpp.
References cmmapOrphanVotes, cs, CacheMultiMap< K, V, Size >::Erase(), GetAdjustedTime(), CacheMultiMap< K, V, Size >::GetItemList(), and LOCK.
Referenced by DoMaintenance().
◆ Clear()
|
inline |
Definition at line 310 of file governance.h.
References CacheMultiMap< K, V, Size >::Clear(), CacheMap< K, V, Size >::Clear(), cmapInvalidVotes, cmapVoteToObject, cmmapOrphanVotes, cs, BCLog::GOBJECT, LOCK, LogPrint, mapErasedGovernanceObjects, mapLastMasternodeObject, and mapObjects.
Referenced by SerializationOp().
◆ ConfirmInventoryRequest()
bool CGovernanceManager::ConfirmInventoryRequest | ( | const CInv & | inv | ) |
This is called by AlreadyHave in net_processing.cpp as part of the inventory retrieval process.
Returns true if we want to retrieve the object, otherwise false. (Note logic is inverted in AlreadyHave).
Definition at line 562 of file governance.cpp.
References cmapVoteToObject, cs, BCLog::GOBJECT, CInv::hash, CacheMap< K, V, Size >::HasKey(), CMasternodeSync::IsBlockchainSynced(), LOCK, LogPrint, mapObjects, mapPostponedObjects, masternodeSync, MSG_GOVERNANCE_OBJECT, MSG_GOVERNANCE_OBJECT_VOTE, setRequestedObjects, setRequestedVotes, CInv::ToString(), and CInv::type.
Referenced by AlreadyHave().
◆ DoMaintenance()
void CGovernanceManager::DoMaintenance | ( | CConnman & | connman | ) |
Definition at line 547 of file governance.cpp.
References CleanOrphanObjects(), fDisableGovernance, CMasternodeSync::IsSynced(), masternodeSync, RequestOrphanObjects(), ShutdownRequested(), and UpdateCachesAndClean().
Referenced by AppInitMain().
◆ FindGovernanceObject()
CGovernanceObject * CGovernanceManager::FindGovernanceObject | ( | const uint256 & | nHash | ) |
Definition at line 463 of file governance.cpp.
References cs, LOCK, and mapObjects.
Referenced by CGovernanceTriggerManager::CleanAndRemove(), CGovernanceTriggerManager::GetActiveTriggers(), CSuperblock::GetGovernanceObject(), gobject_get(), gobject_getcurrentvotes(), gobject_vote_conf(), RequestGovernanceObject(), voteraw(), and VoteWithMasternodes().
◆ GetAllNewerThan()
std::vector< const CGovernanceObject * > CGovernanceManager::GetAllNewerThan | ( | int64_t | nMoreThanTime | ) | const |
Definition at line 516 of file governance.cpp.
References cs, LOCK, and mapObjects.
Referenced by ListObjects().
◆ GetCachedBlockHeight()
|
inline |
Definition at line 356 of file governance.h.
References nCachedBlockHeight.
Referenced by CSuperblock::IsExpired().
◆ GetCurrentVotes()
std::vector< CGovernanceVote > CGovernanceManager::GetCurrentVotes | ( | const uint256 & | nParentHash, |
const COutPoint & | mnCollateralOutpointFilter | ||
) | const |
Definition at line 472 of file governance.cpp.
References cs, deterministicMNManager, CGovernanceObject::GetCurrentMNVotes(), COutPoint::IsNull(), LOCK, vote_rec_t::mapInstances, mapObjects, and CGovernanceVote::SetTime().
Referenced by gobject_getcurrentvotes().
◆ GetLastDiffTime()
|
inline |
Definition at line 353 of file governance.h.
References nTimeLastDiff.
Referenced by gobject_diff().
◆ GetVoteCount()
int CGovernanceManager::GetVoteCount | ( | ) | const |
Definition at line 74 of file governance.cpp.
References cmapVoteToObject, cs, CacheMap< K, V, Size >::GetSize(), and LOCK.
Referenced by CMasternodeSync::ProcessTick().
◆ HaveObjectForHash()
bool CGovernanceManager::HaveObjectForHash | ( | const uint256 & | nHash | ) | const |
Definition at line 47 of file governance.cpp.
References cs, LOCK, mapObjects, and mapPostponedObjects.
Referenced by ProcessGetData().
◆ HaveVoteForHash()
bool CGovernanceManager::HaveVoteForHash | ( | const uint256 & | nHash | ) | const |
Definition at line 66 of file governance.cpp.
References cmapVoteToObject, cs, CacheMap< K, V, Size >::Get(), CGovernanceObject::GetVoteFile(), CGovernanceObjectVoteFile::HasVote(), and LOCK.
Referenced by ProcessGetData().
◆ InitOnLoad()
void CGovernanceManager::InitOnLoad | ( | ) |
Definition at line 1128 of file governance.cpp.
References AddCachedTriggers(), cs, GetTimeMillis(), LOCK, LogPrintf, RebuildIndexes(), and ToString().
Referenced by AppInitMain().
◆ MasternodeRateCheck() [1/2]
bool CGovernanceManager::MasternodeRateCheck | ( | const CGovernanceObject & | govobj, |
bool | fUpdateFailStatus = false |
||
) |
Definition at line 733 of file governance.cpp.
Referenced by gobject_submit(), and ProcessMessage().
◆ MasternodeRateCheck() [2/2]
bool CGovernanceManager::MasternodeRateCheck | ( | const CGovernanceObject & | govobj, |
bool | fUpdateFailStatus, | ||
bool | fForce, | ||
bool & | fRateCheckBypassed | ||
) |
Definition at line 739 of file governance.cpp.
References CRateCheckBuffer::AddTimestamp(), cs, fRateChecksEnabled, GetAdjustedTime(), CChainParams::GetConsensus(), CGovernanceObject::GetCreationTime(), CGovernanceObject::GetHash(), CGovernanceObject::GetMasternodeOutpoint(), CGovernanceObject::GetObjectType(), CRateCheckBuffer::GetRate(), BCLog::GOBJECT, GOVERNANCE_OBJECT_TRIGGER, CMasternodeSync::IsSynced(), LOCK, LogPrint, mapLastMasternodeObject, masternodeSync, MAX_TIME_FUTURE_DEVIATION, Consensus::Params::nPowTargetSpacing, Consensus::Params::nSuperblockCycle, Params(), base_blob< BITS >::ToString(), and COutPoint::ToStringShort().
◆ MasternodeRateUpdate()
void CGovernanceManager::MasternodeRateUpdate | ( | const CGovernanceObject & | govobj | ) |
Definition at line 711 of file governance.cpp.
References CGovernanceObject::GetCreationTime(), CGovernanceObject::GetHash(), CGovernanceObject::GetMasternodeOutpoint(), CGovernanceObject::GetObjectType(), GetTime(), GOVERNANCE_OBJECT_TRIGGER, mapLastMasternodeObject, MAX_TIME_FUTURE_DEVIATION, RELIABLE_PROPAGATION_TIME, and setAdditionalRelayObjects.
Referenced by AddGovernanceObject().
◆ ProcessMessage()
void CGovernanceManager::ProcessMessage | ( | CNode * | pfrom, |
const std::string & | strCommand, | ||
CDataStream & | vRecv, | ||
CConnman & | connman | ||
) |
Definition at line 88 of file governance.cpp.
References AcceptObjectMessage(), AcceptVoteMessage(), AddGovernanceObject(), AddPostponedObject(), CMasternodeSync::BumpAssetLastTime(), CBloomFilter::clear(), cs, cs_main, EraseObjectRequest(), fDisableGovernance, g_enable_bip61, CNode::GetId(), CNode::GetLogString(), GetMainSignals(), CGovernanceException::GetNodePenalty(), CNode::GetSendVersion(), BCLog::GOBJECT, GOVERNANCE_FILTER_PROTO_VERSION, CMasternodeSync::IsBlockchainSynced(), CMasternodeSync::IsSynced(), LOCK, LOCK2, LogPrint, LogPrintf, mapErasedGovernanceObjects, mapObjects, mapPostponedObjects, MasternodeRateCheck(), masternodeSync, MIN_GOVERNANCE_PEER_PROTO_VERSION, Misbehaving(), NetMsgType::MNGOVERNANCEOBJECT, NetMsgType::MNGOVERNANCEOBJECTVOTE, NetMsgType::MNGOVERNANCESYNC, MSG_GOVERNANCE_OBJECT, MSG_GOVERNANCE_OBJECT_VOTE, nCachedBlockHeight, CMainSignals::NotifyGovernanceVote(), CNode::nVersion, ProcessVote(), CConnman::PushMessage(), NetMsgType::REJECT, REJECT_OBSOLETE, strprintf, SyncObjects(), SyncSingleObjVotes(), base_blob< BITS >::ToString(), CBloomFilter::UpdateEmptyFull(), and CGovernanceException::what().
Referenced by ProcessMessage().
◆ ProcessVote()
|
private |
Definition at line 803 of file governance.cpp.
References cmapInvalidVotes, cmapVoteToObject, cmmapOrphanVotes, cs, ENTER_CRITICAL_SECTION, GetAdjustedTime(), CGovernanceVote::GetHash(), CGovernanceVote::GetMasternodeOutpoint(), CGovernanceVote::GetParentHash(), BCLog::GOBJECT, GOVERNANCE_EXCEPTION_PERMANENT_ERROR, GOVERNANCE_EXCEPTION_WARNING, GOVERNANCE_ORPHAN_EXPIRATION_TIME, CacheMap< K, V, Size >::HasKey(), CacheMultiMap< K, V, Size >::Insert(), CacheMap< K, V, Size >::Insert(), CGovernanceObject::IsSetCachedDelete(), CGovernanceObject::IsSetExpired(), LEAVE_CRITICAL_SECTION, LogPrint, mapObjects, CGovernanceObject::ProcessVote(), RequestGovernanceObject(), base_blob< BITS >::ToString(), and COutPoint::ToStringShort().
Referenced by ProcessMessage(), and ProcessVoteAndRelay().
◆ ProcessVoteAndRelay()
|
inline |
Definition at line 381 of file governance.h.
References ProcessVote(), and CGovernanceVote::Relay().
Referenced by gobject_vote_conf(), voteraw(), and VoteWithMasternodes().
◆ RebuildIndexes()
|
private |
Definition at line 1097 of file governance.cpp.
References CacheMap< K, V, Size >::Clear(), cmapVoteToObject, cs, CGovernanceObject::GetVoteFile(), CGovernanceObjectVoteFile::GetVotes(), CacheMap< K, V, Size >::Insert(), LOCK, and mapObjects.
Referenced by InitOnLoad().
◆ RemoveInvalidVotes()
|
private |
Definition at line 1269 of file governance.cpp.
References CDeterministicMNList::BuildDiff(), cmapInvalidVotes, cmapVoteToObject, cmmapOrphanVotes, cs, deterministicMNManager, CacheMap< K, V, Size >::Erase(), CacheMultiMap< K, V, Size >::Erase(), CDeterministicMNStateDiff::Field_keyIDVoting, CDeterministicMNStateDiff::Field_pubKeyOperator, CDeterministicMNList::GetMNByInternalId(), CMasternodeSync::IsSynced(), lastMNListForVotingKeys, LOCK, mapObjects, masternodeSync, and setRequestedVotes.
Referenced by UpdatedBlockTip().
◆ RequestGovernanceObject()
|
private |
Definition at line 922 of file governance.cpp.
References BLOOM_UPDATE_ALL, CBloomFilter::clear(), cs, FindGovernanceObject(), CNode::GetId(), GetRandInt(), CNode::GetSendVersion(), CGovernanceObject::GetVoteFile(), CGovernanceObjectVoteFile::GetVotes(), BCLog::GOBJECT, GOVERNANCE_FILTER_FP_RATE, GOVERNANCE_FILTER_PROTO_VERSION, CBloomFilter::insert(), LOCK, LogPrint, NetMsgType::MNGOVERNANCESYNC, CNode::nVersion, Params(), CConnman::PushMessage(), and base_blob< BITS >::ToString().
Referenced by ProcessVote(), RequestGovernanceObjectVotes(), and RequestOrphanObjects().
◆ RequestGovernanceObjectVotes() [1/2]
Definition at line 959 of file governance.cpp.
References MIN_GOVERNANCE_PEER_PROTO_VERSION, and CNode::nVersion.
Referenced by CMasternodeSync::ProcessTick().
◆ RequestGovernanceObjectVotes() [2/2]
int CGovernanceManager::RequestGovernanceObjectVotes | ( | const std::vector< CNode *> & | vNodesCopy, |
CConnman & | connman | ||
) |
Definition at line 967 of file governance.cpp.
References base_blob< BITS >::begin(), count, cs, cs_main, deterministicMNManager, fMasternodeMode, GetRequestedObjectCount(), GetTime(), BCLog::GOBJECT, GOVERNANCE_OBJECT_TRIGGER, LOCK, LOCK2, LogPrint, CBaseChainParams::MAIN, mapObjects, MAX_INV_SZ, MIN_GOVERNANCE_PEER_PROTO_VERSION, Params(), and RequestGovernanceObject().
◆ RequestOrphanObjects()
|
private |
Definition at line 1222 of file governance.cpp.
References cmmapOrphanVotes, CConnman::CopyNodeVector(), cs, CConnman::FullyConnectedOnly, CacheMultiMap< K, V, Size >::GetKeys(), BCLog::GOBJECT, LOCK, LogPrint, mapObjects, CConnman::ReleaseNodeVector(), and RequestGovernanceObject().
Referenced by DoMaintenance().
◆ SerializationOp()
|
inline |
Definition at line 329 of file governance.h.
References Clear(), cmapInvalidVotes, cmmapOrphanVotes, cs, lastMNListForVotingKeys, LOCK, mapErasedGovernanceObjects, mapLastMasternodeObject, mapObjects, READWRITE, and SERIALIZATION_VERSION_STRING.
◆ SerializeObjectForHash()
bool CGovernanceManager::SerializeObjectForHash | ( | const uint256 & | nHash, |
CDataStream & | ss | ||
) | const |
Definition at line 53 of file governance.cpp.
References cs, LOCK, mapObjects, and mapPostponedObjects.
Referenced by ProcessGetData().
◆ SerializeVoteForHash()
bool CGovernanceManager::SerializeVoteForHash | ( | const uint256 & | nHash, |
CDataStream & | ss | ||
) | const |
Definition at line 80 of file governance.cpp.
References cmapVoteToObject, cs, CacheMap< K, V, Size >::Get(), CGovernanceObject::GetVoteFile(), LOCK, and CGovernanceObjectVoteFile::SerializeVoteToStream().
Referenced by ProcessGetData().
◆ SyncObjects()
Definition at line 664 of file governance.cpp.
References CNetFulfilledRequestManager::AddFulfilledRequest(), CNode::addr, cs, cs_main, CNode::GetId(), CNode::GetSendVersion(), BCLog::GOBJECT, CNetFulfilledRequestManager::HasFulfilledRequest(), CGovernanceObject::IsSetCachedDelete(), CGovernanceObject::IsSetExpired(), CMasternodeSync::IsSynced(), LOCK, LOCK2, LogPrint, LogPrintf, mapObjects, MASTERNODE_SYNC_GOVOBJ, masternodeSync, Misbehaving(), NetMsgType::MNGOVERNANCESYNC, MSG_GOVERNANCE_OBJECT, netfulfilledman, CNode::PushInventory(), CConnman::PushMessage(), NetMsgType::SYNCSTATUSCOUNT, and base_blob< BITS >::ToString().
Referenced by ProcessMessage().
◆ SyncSingleObjVotes()
void CGovernanceManager::SyncSingleObjVotes | ( | CNode * | pnode, |
const uint256 & | nProp, | ||
const CBloomFilter & | filter, | ||
CConnman & | connman | ||
) |
Definition at line 615 of file governance.cpp.
References CBloomFilter::contains(), cs, cs_main, CNode::GetId(), CGovernanceObject::GetObjectType(), CNode::GetSendVersion(), CGovernanceObject::GetVoteFile(), BCLog::GOBJECT, GOVERNANCE_OBJECT_PROPOSAL, CGovernanceObject::IsSetCachedDelete(), CGovernanceObject::IsSetExpired(), CMasternodeSync::IsSynced(), LOCK2, LogPrint, LogPrintf, mapObjects, MASTERNODE_SYNC_GOVOBJ_VOTE, masternodeSync, MSG_GOVERNANCE_OBJECT_VOTE, CNode::PushInventory(), CConnman::PushMessage(), NetMsgType::SYNCSTATUSCOUNT, base_blob< BITS >::ToString(), and VOTE_SIGNAL_FUNDING.
Referenced by ProcessMessage().
◆ ToJson()
UniValue CGovernanceManager::ToJson | ( | ) | const |
Definition at line 1167 of file governance.cpp.
References cmapVoteToObject, cs, CacheMap< K, V, Size >::GetSize(), GOVERNANCE_OBJECT_PROPOSAL, GOVERNANCE_OBJECT_TRIGGER, LOCK, mapErasedGovernanceObjects, mapObjects, Pair(), UniValue::push_back(), and UniValue::VOBJ.
Referenced by gobject_count().
◆ ToString()
std::string CGovernanceManager::ToString | ( | ) | const |
Definition at line 1139 of file governance.cpp.
References cmapVoteToObject, cs, CacheMap< K, V, Size >::GetSize(), GOVERNANCE_OBJECT_PROPOSAL, GOVERNANCE_OBJECT_TRIGGER, LOCK, mapErasedGovernanceObjects, mapObjects, and strprintf.
Referenced by gobject_count(), InitOnLoad(), and UpdateCachesAndClean().
◆ UpdateCachesAndClean()
void CGovernanceManager::UpdateCachesAndClean | ( | ) |
Definition at line 351 of file governance.cpp.
References CGovernanceTriggerManager::CleanAndRemove(), cmapVoteToObject, cs, cs_main, CacheMap< K, V, Size >::Erase(), fRateChecksEnabled, GetAdjustedTime(), CMasternodeMetaMan::GetAndClearDirtyGovernanceObjectHashes(), CChainParams::GetConsensus(), CGovernanceObject::GetCreationTime(), CGovernanceObject::GetDataAsHexString(), CGovernanceObject::GetDeletionTime(), CGovernanceObject::GetHash(), CacheMap< K, V, Size >::GetItemList(), CGovernanceObject::GetObjectType(), BCLog::GOBJECT, GOVERNANCE_DELETION_DELAY, GOVERNANCE_OBJECT_PROPOSAL, CMasternodeSync::IsBlockchainSynced(), CGovernanceObject::IsSetCachedDelete(), CGovernanceObject::IsSetDirtyCache(), CGovernanceObject::IsSetExpired(), LOCK2, LogPrint, LogPrintf, mapErasedGovernanceObjects, mapObjects, masternodeSync, mmetaman, Consensus::Params::nPowTargetSpacing, Consensus::Params::nSuperblockCycle, Params(), CGovernanceObject::PrepareDeletion(), CMasternodeMetaMan::RemoveGovernanceObject(), base_blob< BITS >::ToString(), ToString(), triggerman, CGovernanceObject::UpdateLocalValidity(), and CGovernanceObject::UpdateSentinelVariables().
Referenced by CheckAndRemove(), DoMaintenance(), and CDSNotificationInterface::NotifyMasternodeListChanged().
◆ UpdatedBlockTip()
void CGovernanceManager::UpdatedBlockTip | ( | const CBlockIndex * | pindex, |
CConnman & | connman | ||
) |
Definition at line 1199 of file governance.cpp.
References CheckPostponedObjects(), deterministicMNManager, CSuperblockManager::ExecuteBestSuperblock(), BCLog::GOBJECT, LogPrint, nCachedBlockHeight, CBlockIndex::nHeight, and RemoveInvalidVotes().
Referenced by CDSNotificationInterface::UpdatedBlockTip().
◆ UpdateLastDiffTime()
|
inline |
Friends And Related Function Documentation
◆ CGovernanceObject
|
friend |
Definition at line 153 of file governance.h.
Member Data Documentation
◆ ADD_SERIALIZE_METHODS
CGovernanceManager::ADD_SERIALIZE_METHODS |
Definition at line 326 of file governance.h.
◆ cmapInvalidVotes
|
private |
Definition at line 241 of file governance.h.
Referenced by AddInvalidVote(), Clear(), ProcessVote(), RemoveInvalidVotes(), and SerializationOp().
◆ cmapVoteToObject
|
private |
Definition at line 239 of file governance.h.
Referenced by Clear(), ConfirmInventoryRequest(), GetVoteCount(), HaveVoteForHash(), ProcessVote(), RebuildIndexes(), RemoveInvalidVotes(), SerializeVoteForHash(), ToJson(), ToString(), and UpdateCachesAndClean().
◆ cmmapOrphanVotes
|
private |
Definition at line 243 of file governance.h.
Referenced by CheckOrphanVotes(), CleanOrphanObjects(), Clear(), ProcessVote(), RemoveInvalidVotes(), RequestOrphanObjects(), and SerializationOp().
◆ cs
|
mutable |
Definition at line 278 of file governance.h.
Referenced by AcceptObjectMessage(), AcceptVoteMessage(), AddCachedTriggers(), AddGovernanceObject(), CGovernanceTriggerManager::AddNewTrigger(), AddPostponedObject(), AreRateChecksEnabled(), CheckOrphanVotes(), CheckPostponedObjects(), CGovernanceTriggerManager::CleanAndRemove(), CleanOrphanObjects(), Clear(), ConfirmInventoryRequest(), CSuperblockManager::ExecuteBestSuperblock(), FindGovernanceObject(), CGovernanceTriggerManager::GetActiveTriggers(), GetAllNewerThan(), CSuperblockManager::GetBestSuperblock(), GetCurrentVotes(), CSuperblock::GetGovernanceObject(), CSuperblockManager::GetRequiredPaymentsString(), CSuperblockManager::GetSuperblockPayments(), GetVoteCount(), gobject_get(), gobject_getcurrentvotes(), gobject_vote_conf(), HaveObjectForHash(), HaveVoteForHash(), InitOnLoad(), CSuperblockManager::IsSuperblockTriggered(), CSuperblockManager::IsValid(), ListObjects(), MasternodeRateCheck(), ProcessMessage(), ProcessVote(), RebuildIndexes(), RemoveInvalidVotes(), RequestGovernanceObject(), RequestGovernanceObjectVotes(), RequestOrphanObjects(), SerializationOp(), SerializeObjectForHash(), SerializeVoteForHash(), SyncObjects(), SyncSingleObjVotes(), ToJson(), ToString(), UpdateCachesAndClean(), voteraw(), and VoteWithMasternodes().
◆ fRateChecksEnabled
|
private |
Definition at line 251 of file governance.h.
Referenced by AreRateChecksEnabled(), CheckOrphanVotes(), MasternodeRateCheck(), and UpdateCachesAndClean().
◆ lastMNListForVotingKeys
|
private |
Definition at line 254 of file governance.h.
Referenced by RemoveInvalidVotes(), and SerializationOp().
◆ mapErasedGovernanceObjects
|
private |
Definition at line 234 of file governance.h.
Referenced by Clear(), ProcessMessage(), SerializationOp(), ToJson(), ToString(), and UpdateCachesAndClean().
◆ mapLastMasternodeObject
|
private |
Definition at line 245 of file governance.h.
Referenced by Clear(), MasternodeRateCheck(), MasternodeRateUpdate(), and SerializationOp().
◆ mapObjects
|
private |
Definition at line 229 of file governance.h.
Referenced by AddCachedTriggers(), AddGovernanceObject(), CheckPostponedObjects(), Clear(), ConfirmInventoryRequest(), FindGovernanceObject(), GetAllNewerThan(), GetCurrentVotes(), HaveObjectForHash(), ProcessMessage(), ProcessVote(), RebuildIndexes(), RemoveInvalidVotes(), RequestGovernanceObjectVotes(), RequestOrphanObjects(), SerializationOp(), SerializeObjectForHash(), SyncObjects(), SyncSingleObjVotes(), ToJson(), ToString(), and UpdateCachesAndClean().
◆ mapPostponedObjects
|
private |
Definition at line 236 of file governance.h.
Referenced by AddPostponedObject(), CheckPostponedObjects(), ConfirmInventoryRequest(), HaveObjectForHash(), ProcessMessage(), and SerializeObjectForHash().
◆ MAX_CACHE_SIZE
|
staticprivate |
Definition at line 216 of file governance.h.
◆ MAX_TIME_FUTURE_DEVIATION
|
staticprivate |
Definition at line 220 of file governance.h.
Referenced by CheckPostponedObjects(), MasternodeRateCheck(), and MasternodeRateUpdate().
◆ nCachedBlockHeight
|
private |
Definition at line 226 of file governance.h.
Referenced by AddGovernanceObject(), GetCachedBlockHeight(), ProcessMessage(), and UpdatedBlockTip().
◆ nTimeLastDiff
|
private |
Definition at line 223 of file governance.h.
Referenced by GetLastDiffTime(), and UpdateLastDiffTime().
◆ RELIABLE_PROPAGATION_TIME
|
staticprivate |
Definition at line 221 of file governance.h.
Referenced by CheckPostponedObjects(), and MasternodeRateUpdate().
◆ SERIALIZATION_VERSION_STRING
|
staticprivate |
Definition at line 218 of file governance.h.
Referenced by SerializationOp().
◆ setAdditionalRelayObjects
|
private |
Definition at line 237 of file governance.h.
Referenced by CheckPostponedObjects(), and MasternodeRateUpdate().
◆ setRequestedObjects
|
private |
Definition at line 247 of file governance.h.
Referenced by AcceptObjectMessage(), and ConfirmInventoryRequest().
◆ setRequestedVotes
|
private |
Definition at line 249 of file governance.h.
Referenced by AcceptVoteMessage(), ConfirmInventoryRequest(), and RemoveInvalidVotes().
The documentation for this class was generated from the following files:
- src/governance/governance.h
- src/governance/governance.cpp