Dash Core  0.12.2.1
P2P Digital Currency
CSuperblock Class Reference

#include <governance-classes.h>

+ Inheritance diagram for CSuperblock:

Public Member Functions

 CSuperblock ()
 
 CSuperblock (uint256 &nHash)
 
int GetStatus ()
 
void SetStatus (int nStatusIn)
 
bool IsExecuted ()
 
void SetExecuted ()
 
CGovernanceObjectGetGovernanceObject ()
 
int GetBlockStart ()
 
int CountPayments ()
 
bool GetPayment (int nPaymentIndex, CGovernancePayment &paymentRet)
 
CAmount GetPaymentsTotalAmount ()
 
bool IsValid (const CTransaction &txNew, int nBlockHeight, CAmount blockReward)
 
- Public Member Functions inherited from CGovernanceObject
virtual uint256 GetHash ()=0
 
 CGovernanceObject ()
 
 CGovernanceObject (uint256 nHashParentIn, int nRevisionIn, int64_t nTime, uint256 nCollateralHashIn, std::string strDataIn)
 
 CGovernanceObject (const CGovernanceObject &other)
 
void swap (CGovernanceObject &first, CGovernanceObject &second)
 
int64_t GetCreationTime () const
 
int64_t GetDeletionTime () const
 
int GetObjectType () const
 
const uint256GetCollateralHash () const
 
const CTxInGetMasternodeVin () const
 
bool IsSetCachedFunding () const
 
bool IsSetCachedValid () const
 
bool IsSetCachedDelete () const
 
bool IsSetCachedEndorsed () const
 
bool IsSetDirtyCache () const
 
bool IsSetExpired () const
 
void InvalidateVoteCache ()
 
CGovernanceObjectVoteFileGetVoteFile ()
 
void SetMasternodeVin (const COutPoint &outpoint)
 
bool Sign (CKey &keyMasternode, CPubKey &pubKeyMasternode)
 
bool CheckSignature (CPubKey &pubKeyMasternode)
 
std::string GetSignatureMessage () const
 
bool IsValidLocally (std::string &strError, bool fCheckCollateral)
 
bool IsValidLocally (std::string &strError, bool &fMissingMasternode, bool &fMissingConfirmations, bool fCheckCollateral)
 
bool IsCollateralValid (std::string &strError, bool &fMissingConfirmations)
 Check the collateral transaction for the budget proposal/finalized budget. More...
 
void UpdateLocalValidity ()
 
void UpdateSentinelVariables ()
 
int GetObjectSubtype ()
 
CAmount GetMinCollateralFee ()
 
UniValue GetJSONObject ()
 
void Relay (CConnman &connman)
 
uint256 GetHash () const
 
int CountMatchingVotes (vote_signal_enum_t eVoteSignalIn, vote_outcome_enum_t eVoteOutcomeIn) const
 
int GetAbsoluteYesCount (vote_signal_enum_t eVoteSignalIn) const
 
int GetAbsoluteNoCount (vote_signal_enum_t eVoteSignalIn) const
 
int GetYesCount (vote_signal_enum_t eVoteSignalIn) const
 
int GetNoCount (vote_signal_enum_t eVoteSignalIn) const
 
int GetAbstainCount (vote_signal_enum_t eVoteSignalIn) const
 
bool GetCurrentMNVotes (const COutPoint &mnCollateralOutpoint, vote_rec_t &voteRecord)
 
std::string GetDataAsHex ()
 
std::string GetDataAsString ()
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action, int nType, int nVersion)
 
CGovernanceObjectoperator= (CGovernanceObject from)
 

Static Public Member Functions

static bool IsValidBlockHeight (int nBlockHeight)
 
static CAmount GetPaymentsLimit (int nBlockHeight)
 

Private Member Functions

void ParsePaymentSchedule (std::string &strPaymentAddresses, std::string &strPaymentAmounts)
 

Private Attributes

uint256 nGovObjHash
 
int nEpochStart
 
int nStatus
 
std::vector< CGovernancePaymentvecPayments
 

Additional Inherited Members

- Public Types inherited from CGovernanceObject
typedef std::map< COutPoint, vote_rec_tvote_m_t
 
typedef vote_m_t::iterator vote_m_it
 
typedef vote_m_t::const_iterator vote_m_cit
 
typedef CacheMultiMap< COutPoint, vote_time_pair_tvote_mcache_t
 
- Public Attributes inherited from CGovernanceObject
 ADD_SERIALIZE_METHODS
 

Detailed Description

Trigger : Superblock

  • Create payments on the network

object structure: { "governance_object_id" : last_id, "type" : govtypes.trigger, "subtype" : "superblock", "superblock_name" : superblock_name, "start_epoch" : start_epoch, "payment_addresses" : "addr1|addr2|addr3", "payment_amounts" : "amount1|amount2|amount3" }

Definition at line 146 of file governance-classes.h.

Constructor & Destructor Documentation

◆ CSuperblock() [1/2]

CSuperblock::CSuperblock ( )

Definition at line 465 of file governance-classes.cpp.

◆ CSuperblock() [2/2]

CSuperblock::CSuperblock ( uint256 nHash)

Definition at line 473 of file governance-classes.cpp.

Member Function Documentation

◆ CountPayments()

int CSuperblock::CountPayments ( )
inline

Definition at line 202 of file governance-classes.h.

Referenced by GetPaymentsTotalAmount(), and IsValid().

◆ GetBlockStart()

int CSuperblock::GetBlockStart ( )
inline

Definition at line 180 of file governance-classes.h.

◆ GetGovernanceObject()

CGovernanceObject* CSuperblock::GetGovernanceObject ( )
inline

Definition at line 173 of file governance-classes.h.

Referenced by CSuperblock(), and IsValid().

◆ GetPayment()

bool CSuperblock::GetPayment ( int  nPaymentIndex,
CGovernancePayment paymentRet 
)

Definition at line 613 of file governance-classes.cpp.

Referenced by IsValid().

◆ GetPaymentsLimit()

CAmount CSuperblock::GetPaymentsLimit ( int  nBlockHeight)
static

Definition at line 527 of file governance-classes.cpp.

Referenced by getsuperblockbudget(), IsBlockValueValid(), and IsValid().

◆ GetPaymentsTotalAmount()

CAmount CSuperblock::GetPaymentsTotalAmount ( )

Definition at line 623 of file governance-classes.cpp.

Referenced by IsValid().

◆ GetStatus()

int CSuperblock::GetStatus ( )
inline

Definition at line 165 of file governance-classes.h.

◆ IsExecuted()

bool CSuperblock::IsExecuted ( )
inline

Definition at line 169 of file governance-classes.h.

◆ IsValid()

bool CSuperblock::IsValid ( const CTransaction txNew,
int  nBlockHeight,
CAmount  blockReward 
)

Is Transaction Valid

  • Does this transaction match the superblock?

Definition at line 641 of file governance-classes.cpp.

◆ IsValidBlockHeight()

bool CSuperblock::IsValidBlockHeight ( int  nBlockHeight)
static

Is Valid Superblock Height

  • See if a block at this height can be a superblock

Definition at line 520 of file governance-classes.cpp.

Referenced by CSuperblockManager::GetBestSuperblock(), GetPaymentsLimit(), IsBlockValueValid(), CSuperblockManager::IsSuperblockTriggered(), and IsValid().

◆ ParsePaymentSchedule()

void CSuperblock::ParsePaymentSchedule ( std::string &  strPaymentAddresses,
std::string &  strPaymentAmounts 
)
private

Definition at line 545 of file governance-classes.cpp.

Referenced by CSuperblock().

◆ SetExecuted()

void CSuperblock::SetExecuted ( )
inline

Definition at line 171 of file governance-classes.h.

◆ SetStatus()

void CSuperblock::SetStatus ( int  nStatusIn)
inline

Definition at line 166 of file governance-classes.h.

Member Data Documentation

◆ nEpochStart

int CSuperblock::nEpochStart
private

Definition at line 151 of file governance-classes.h.

Referenced by CSuperblock(), and GetBlockStart().

◆ nGovObjHash

uint256 CSuperblock::nGovObjHash
private

Definition at line 149 of file governance-classes.h.

Referenced by GetGovernanceObject().

◆ nStatus

int CSuperblock::nStatus
private

Definition at line 152 of file governance-classes.h.

Referenced by GetStatus(), IsExecuted(), SetExecuted(), and SetStatus().

◆ vecPayments

std::vector<CGovernancePayment> CSuperblock::vecPayments
private

The documentation for this class was generated from the following files: