Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <governance-vote.h>
Public Member Functions | |
CGovernanceVote () | |
CGovernanceVote (const COutPoint &outpointMasternodeIn, const uint256 &nParentHashIn, vote_signal_enum_t eVoteSignalIn, vote_outcome_enum_t eVoteOutcomeIn) | |
bool | IsValid () const |
bool | IsSynced () const |
int64_t | GetTimestamp () const |
vote_signal_enum_t | GetSignal () const |
vote_outcome_enum_t | GetOutcome () const |
const uint256 & | GetParentHash () const |
void | SetTime (int64_t nTimeIn) |
void | SetSignature (const std::vector< unsigned char > &vchSigIn) |
bool | Sign (const CKey &key, const CKeyID &keyID) |
bool | CheckSignature (const CKeyID &keyID) const |
bool | Sign (const CBLSSecretKey &key) |
bool | CheckSignature (const CBLSPublicKey &pubKey) const |
bool | IsValid (bool useVotingKey) const |
void | Relay (CConnman &connman) const |
const COutPoint & | GetMasternodeOutpoint () const |
uint256 | GetHash () const |
GetHash() More... | |
uint256 | GetSignatureHash () const |
std::string | ToString () const |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action) |
Public Attributes | |
ADD_SERIALIZE_METHODS | |
Private Member Functions | |
void | UpdateHash () const |
Private Attributes | |
bool | fValid |
bool | fSynced |
int | nVoteSignal |
COutPoint | masternodeOutpoint |
uint256 | nParentHash |
int | nVoteOutcome |
int64_t | nTime |
std::vector< unsigned char > | vchSig |
const uint256 | hash |
Memory only. More... | |
Friends | |
bool | operator== (const CGovernanceVote &vote1, const CGovernanceVote &vote2) |
bool | operator< (const CGovernanceVote &vote1, const CGovernanceVote &vote2) |
Detailed Description
Definition at line 54 of file governance-vote.h.
Constructor & Destructor Documentation
◆ CGovernanceVote() [1/2]
CGovernanceVote::CGovernanceVote | ( | ) |
Definition at line 80 of file governance-vote.cpp.
◆ CGovernanceVote() [2/2]
CGovernanceVote::CGovernanceVote | ( | const COutPoint & | outpointMasternodeIn, |
const uint256 & | nParentHashIn, | ||
vote_signal_enum_t | eVoteSignalIn, | ||
vote_outcome_enum_t | eVoteOutcomeIn | ||
) |
Definition at line 92 of file governance-vote.cpp.
References UpdateHash().
Member Function Documentation
◆ CheckSignature() [1/2]
bool CGovernanceVote::CheckSignature | ( | const CKeyID & | keyID | ) | const |
Definition at line 198 of file governance-vote.cpp.
References GetSignatureHash(), BCLog::GOBJECT, hash, LogPrint, masternodeOutpoint, nParentHash, nTime, nVoteOutcome, nVoteSignal, Params(), CBaseChainParams::TESTNET, base_blob< BITS >::ToString(), COutPoint::ToStringShort(), vchSig, CHashSigner::VerifyHash(), and CMessageSigner::VerifyMessage().
Referenced by IsValid().
◆ CheckSignature() [2/2]
bool CGovernanceVote::CheckSignature | ( | const CBLSPublicKey & | pubKey | ) | const |
Definition at line 236 of file governance-vote.cpp.
References GetSignatureHash(), hash, LogPrintf, CBLSWrapper< ImplType, _SerSize, C >::SetBuf(), vchSig, and CBLSSignature::VerifyInsecure().
◆ GetHash()
uint256 CGovernanceVote::GetHash | ( | ) | const |
GET UNIQUE HASH WITH DETERMINISTIC VALUE OF THIS SPECIFIC VOTE
Definition at line 153 of file governance-vote.cpp.
References hash.
Referenced by CGovernanceManager::AddInvalidVote(), CGovernanceObjectVoteFile::AddVote(), IsValid(), CZMQPublishHashGovernanceVoteNotifier::NotifyGovernanceVote(), CZMQPublishRawGovernanceVoteNotifier::NotifyGovernanceVote(), CGovernanceObject::ProcessVote(), CGovernanceManager::ProcessVote(), CGovernanceObjectVoteFile::RebuildIndex(), Relay(), and CGovernanceObject::RemoveInvalidVotes().
◆ GetMasternodeOutpoint()
|
inline |
Definition at line 105 of file governance-vote.h.
References masternodeOutpoint.
Referenced by CGovernanceObject::ProcessVote(), CGovernanceManager::ProcessVote(), and CGovernanceObjectVoteFile::RemoveOldVotes().
◆ GetOutcome()
|
inline |
Definition at line 86 of file governance-vote.h.
References nVoteOutcome.
Referenced by CGovernanceObject::ProcessVote(), and ToString().
◆ GetParentHash()
|
inline |
Definition at line 88 of file governance-vote.h.
References nParentHash.
Referenced by CGovernanceObject::ProcessVote(), CGovernanceManager::ProcessVote(), and CGovernanceObjectVoteFile::RemoveOldVotes().
◆ GetSignal()
|
inline |
Definition at line 84 of file governance-vote.h.
References nVoteSignal.
Referenced by CGovernanceObject::ProcessVote(), CGovernanceObjectVoteFile::RemoveOldVotes(), ToString(), and voteraw().
◆ GetSignatureHash()
uint256 CGovernanceVote::GetSignatureHash | ( | ) | const |
Definition at line 158 of file governance-vote.cpp.
References SerializeHash().
Referenced by CheckSignature(), and Sign().
◆ GetTimestamp()
|
inline |
Definition at line 82 of file governance-vote.h.
References nTime.
Referenced by CGovernanceObject::ProcessVote(), and CGovernanceObjectVoteFile::RemoveOldVotes().
◆ IsSynced()
|
inline |
Definition at line 80 of file governance-vote.h.
References fSynced.
◆ IsValid() [1/2]
|
inline |
Definition at line 78 of file governance-vote.h.
References fValid.
Referenced by CGovernanceObject::ProcessVote(), and voteraw().
◆ IsValid() [2/2]
bool CGovernanceVote::IsValid | ( | bool | useVotingKey | ) | const |
Definition at line 248 of file governance-vote.cpp.
References CheckSignature(), deterministicMNManager, GetAdjustedTime(), GetHash(), BCLog::GOBJECT, LogPrint, masternodeOutpoint, MAX_SUPPORTED_VOTE_SIGNAL, nTime, nVoteOutcome, nVoteSignal, ToString(), and COutPoint::ToStringShort().
◆ Relay()
void CGovernanceVote::Relay | ( | CConnman & | connman | ) | const |
Definition at line 115 of file governance-vote.cpp.
References deterministicMNManager, GetHash(), BCLog::GOBJECT, GOVERNANCE_POSE_BANNED_VOTES_VERSION, CMasternodeSync::IsSynced(), LogPrint, masternodeOutpoint, masternodeSync, MIN_GOVERNANCE_PEER_PROTO_VERSION, MSG_GOVERNANCE_OBJECT_VOTE, and CConnman::RelayInv().
Referenced by CGovernanceManager::CheckOrphanVotes(), and CGovernanceManager::ProcessVoteAndRelay().
◆ SerializationOp()
|
inline |
Definition at line 121 of file governance-vote.h.
References masternodeOutpoint, nParentHash, nTime, nVoteOutcome, nVoteSignal, READWRITE, SER_GETHASH, UpdateHash(), and vchSig.
◆ SetSignature()
|
inline |
◆ SetTime()
|
inline |
Definition at line 90 of file governance-vote.h.
References nTime, and UpdateHash().
Referenced by CGovernanceManager::GetCurrentVotes(), CGovernanceObject::RemoveInvalidVotes(), and voteraw().
◆ Sign() [1/2]
Definition at line 163 of file governance-vote.cpp.
References GetSignatureHash(), hash, LogPrintf, masternodeOutpoint, nParentHash, nTime, nVoteOutcome, nVoteSignal, Params(), CHashSigner::SignHash(), CMessageSigner::SignMessage(), CBaseChainParams::TESTNET, base_blob< BITS >::ToString(), COutPoint::ToStringShort(), vchSig, CHashSigner::VerifyHash(), and CMessageSigner::VerifyMessage().
Referenced by gobject_vote_conf(), and VoteWithMasternodes().
◆ Sign() [2/2]
bool CGovernanceVote::Sign | ( | const CBLSSecretKey & | key | ) |
Definition at line 225 of file governance-vote.cpp.
References CBLSWrapper< ImplType, _SerSize, C >::GetBuf(), GetSignatureHash(), hash, CBLSWrapper< ImplType, _SerSize, C >::IsValid(), CBLSSecretKey::Sign(), and vchSig.
◆ ToString()
std::string CGovernanceVote::ToString | ( | ) | const |
Definition at line 105 of file governance-vote.cpp.
References CGovernanceVoting::ConvertOutcomeToString(), CGovernanceVoting::ConvertSignalToString(), GetOutcome(), GetSignal(), masternodeOutpoint, nTime, and COutPoint::ToStringShort().
Referenced by IsValid(), and CZMQPublishRawGovernanceVoteNotifier::NotifyGovernanceVote().
◆ UpdateHash()
|
private |
Definition at line 140 of file governance-vote.cpp.
References CHashWriter::GetHash(), hash, masternodeOutpoint, nParentHash, nTime, nVoteOutcome, nVoteSignal, PROTOCOL_VERSION, and SER_GETHASH.
Referenced by CGovernanceVote(), SerializationOp(), and SetTime().
Friends And Related Function Documentation
◆ operator<
|
friend |
Definition at line 290 of file governance-vote.cpp.
◆ operator==
|
friend |
Definition at line 280 of file governance-vote.cpp.
Member Data Documentation
◆ ADD_SERIALIZE_METHODS
CGovernanceVote::ADD_SERIALIZE_METHODS |
Definition at line 118 of file governance-vote.h.
◆ fSynced
|
private |
Definition at line 62 of file governance-vote.h.
Referenced by IsSynced().
◆ fValid
|
private |
Definition at line 61 of file governance-vote.h.
Referenced by IsValid().
◆ hash
|
private |
Memory only.
Definition at line 71 of file governance-vote.h.
Referenced by CheckSignature(), GetHash(), Sign(), and UpdateHash().
◆ masternodeOutpoint
|
private |
Definition at line 64 of file governance-vote.h.
Referenced by CheckSignature(), GetMasternodeOutpoint(), IsValid(), operator<(), operator==(), Relay(), SerializationOp(), Sign(), ToString(), and UpdateHash().
◆ nParentHash
|
private |
Definition at line 65 of file governance-vote.h.
Referenced by CheckSignature(), GetParentHash(), operator<(), operator==(), SerializationOp(), Sign(), and UpdateHash().
◆ nTime
|
private |
Definition at line 67 of file governance-vote.h.
Referenced by CheckSignature(), GetTimestamp(), IsValid(), operator<(), operator==(), SerializationOp(), SetTime(), Sign(), ToString(), and UpdateHash().
◆ nVoteOutcome
|
private |
Definition at line 66 of file governance-vote.h.
Referenced by CheckSignature(), GetOutcome(), IsValid(), operator<(), operator==(), SerializationOp(), Sign(), and UpdateHash().
◆ nVoteSignal
|
private |
Definition at line 63 of file governance-vote.h.
Referenced by CheckSignature(), GetSignal(), IsValid(), operator<(), operator==(), SerializationOp(), Sign(), and UpdateHash().
◆ vchSig
|
private |
Definition at line 68 of file governance-vote.h.
Referenced by CheckSignature(), SerializationOp(), SetSignature(), and Sign().
The documentation for this class was generated from the following files:
- src/governance/governance-vote.h
- src/governance/governance-vote.cpp