5 #ifndef GOVERNANCE_OBJECT_H 6 #define GOVERNANCE_OBJECT_H 59 return (p1.first < p2.first);
76 template <
typename Stream,
typename Operation>
77 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion)
83 if(ser_action.ForRead()) {
100 template <
typename Stream,
typename Operation>
265 bool IsValidLocally(std::string& strError,
bool fCheckCollateral);
267 bool IsValidLocally(std::string& strError,
bool& fMissingMasternode,
bool& fMissingConfirmations,
bool fCheckCollateral);
307 template <
typename Stream,
typename Operation>
322 LogPrint(
"gobject",
"CGovernanceObject::SerializationOp Reading/writing votes from/to disk\n");
void UpdateSentinelVariables()
bool GetCurrentMNVotes(const COutPoint &mnCollateralOutpoint, vote_rec_t &voteRecord)
static const int64_t GOVERNANCE_FEE_CONFIRMATIONS
static const int64_t GOVERNANCE_ORPHAN_EXPIRATION_TIME
vote_m_t::iterator vote_m_it
std::pair< CGovernanceVote, int64_t > vote_time_pair_t
static const int GOVERNANCE_TRIGGER_EXPIRATION_BLOCKS
bool fCachedValid
true == minimum network has been reached flagging this object as a valid and understood goverance obj...
vote_instance_m_t mapInstances
static const int MIN_GOVERNANCE_PEER_PROTO_VERSION
static const CAmount COIN
CGovernanceObject & operator=(CGovernanceObject from)
static const CAmount GOVERNANCE_PROPOSAL_FEE_TX
bool fCachedLocalValidity
is valid by blockchain
const CTxIn & GetMasternodeVin() const
bool IsSetExpired() const
bool fUnparsable
Failed to parse object data.
std::string strLocalValidityError
static const int64_t GOVERNANCE_MIN_RELAY_FEE_CONFIRMATIONS
static const int GOVERNANCE_OBJECT_PROPOSAL
int CountMatchingVotes(vote_signal_enum_t eVoteSignalIn, vote_outcome_enum_t eVoteOutcomeIn) const
CGovernanceObjectVoteFile fileVotes
void InvalidateVoteCache()
static const int SEEN_OBJECT_ERROR_INVALID
void ClearMasternodeVotes()
Called when MN's which have voted on this object have been removed.
bool fExpired
Object is no longer of interest.
vote_outcome_enum_t eOutcome
static const int64_t GOVERNANCE_WATCHDOG_EXPIRATION_TIME
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
int nObjectType
Object typecode.
int64_t GetCreationTime() const
static const double GOVERNANCE_FILTER_FP_RATE
std::map< int, vote_instance_t > vote_instance_m_t
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::string GetSignatureMessage() const
static const int GOVERNANCE_OBJECT_WATCHDOG
static int LogPrint(const char *category, const char *format)
void Relay(CConnman &connman)
bool fDirtyCache
object was updated and cached values should be updated soon
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
CacheMultiMap< COutPoint, vote_time_pair_t > vote_mcache_t
int64_t nDeletionTime
time this object was marked for deletion
std::string strData
Data field - can be used for anything.
std::map< COutPoint, vote_rec_t > vote_m_t
vote_m_t::const_iterator vote_m_cit
int GetYesCount(vote_signal_enum_t eVoteSignalIn) const
std::string GetDataAsHex()
bool IsSetCachedEndorsed() const
int GetAbsoluteNoCount(vote_signal_enum_t eVoteSignalIn) const
static const int GOVERNANCE_OBJECT_TRIGGER
std::string GetDataAsString()
static const int SEEN_OBJECT_IS_VALID
bool IsSetCachedValid() const
static const int SEEN_OBJECT_ERROR_IMMATURE
bool IsCollateralValid(std::string &strError, bool &fMissingConfirmations)
Check the collateral transaction for the budget proposal/finalized budget.
int64_t GetDeletionTime() const
static const int GOVERNANCE_FILTER_PROTO_VERSION
static const int SEEN_OBJECT_EXECUTED
static const int SEEN_OBJECT_UNKNOWN
const uint256 & GetCollateralHash() const
vote_mcache_t mapOrphanVotes
Limited map of votes orphaned by MN.
bool CheckSignature(CPubKey &pubKeyMasternode)
bool IsSetCachedDelete() const
bool IsValidLocally(std::string &strError, bool fCheckCollateral)
void swap(CGovernanceObject &first, CGovernanceObject &second)
void SetMasternodeVin(const COutPoint &outpoint)
bool IsSetDirtyCache() const
void GetData(UniValue &objResult)
vote_instance_t(vote_outcome_enum_t eOutcomeIn=VOTE_OUTCOME_NONE, int64_t nTimeIn=0, int64_t nCreationTimeIn=0)
int GetAbstainCount(vote_signal_enum_t eVoteSignalIn) const
bool IsSetCachedFunding() const
CCriticalSection cs
critical section to protect the inner data structures
static const int64_t GOVERNANCE_UPDATE_MIN
bool Sign(CKey &keyMasternode, CPubKey &pubKeyMasternode)
int GetAbsoluteYesCount(vote_signal_enum_t eVoteSignalIn) const
CTxIn vinMasternode
Masternode info for signed objects.
#define LIMITED_STRING(obj, n)
static const int MAX_GOVERNANCE_OBJECT_DATA_SIZE
uint256 nHashParent
parent object, 0 is root
static const int GOVERNANCE_OBJECT_UNKNOWN
uint256 nCollateralHash
fee-tx
bool fCachedFunding
true == minimum network support has been reached for this object to be funded (doesn't mean it will f...
virtual uint256 GetHash()=0
int GetNoCount(vote_signal_enum_t eVoteSignalIn) const
int64_t nTime
time this object was created
static const int64_t GOVERNANCE_DELETION_DELAY
CGovernanceObjectVoteFile & GetVoteFile()
std::vector< unsigned char > vchSig
void CheckOrphanVotes(CConnman &connman)
vote_m_t mapCurrentMNVotes
bool operator<(const vote_time_pair_t &p1, const vote_time_pair_t &p2)
int GetObjectType() const
CAmount GetMinCollateralFee()
bool ProcessVote(CNode *pfrom, const CGovernanceVote &vote, CGovernanceException &exception, CConnman &connman)
vote_instance_m_t::const_iterator vote_instance_m_cit
vote_instance_m_t::iterator vote_instance_m_it
void UpdateLocalValidity()
bool fCachedDelete
true == minimum network support has been reached saying this object should be deleted from the system...
int nRevision
object revision in the system