Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Trigger : Superblock. More...
#include <governance-classes.h>
Public Member Functions | |
CSuperblock () | |
CSuperblock (uint256 &nHash) | |
int | GetStatus () |
void | SetStatus (int nStatusIn) |
void | SetExecuted () |
CGovernanceObject * | GetGovernanceObject () |
int | GetBlockHeight () |
int | CountPayments () |
bool | GetPayment (int nPaymentIndex, CGovernancePayment &paymentRet) |
CAmount | GetPaymentsTotalAmount () |
bool | IsValid (const CTransaction &txNew, int nBlockHeight, CAmount blockReward) |
Is Transaction Valid. More... | |
bool | IsExpired () const |
Public Member Functions inherited from CGovernanceObject | |
CGovernanceObject () | |
CGovernanceObject (const uint256 &nHashParentIn, int nRevisionIn, int64_t nTime, const uint256 &nCollateralHashIn, const std::string &strDataHexIn) | |
CGovernanceObject (const CGovernanceObject &other) | |
int64_t | GetCreationTime () const |
int64_t | GetDeletionTime () const |
int | GetObjectType () const |
const uint256 & | GetCollateralHash () const |
const COutPoint & | GetMasternodeOutpoint () const |
bool | IsSetCachedFunding () const |
bool | IsSetCachedValid () const |
bool | IsSetCachedDelete () const |
bool | IsSetCachedEndorsed () const |
bool | IsSetDirtyCache () const |
bool | IsSetExpired () const |
void | SetExpired () |
const CGovernanceObjectVoteFile & | GetVoteFile () const |
void | SetMasternodeOutpoint (const COutPoint &outpoint) |
bool | Sign (const CBLSSecretKey &key) |
bool | CheckSignature (const CBLSPublicKey &pubKey) const |
uint256 | GetSignatureHash () const |
bool | IsValidLocally (std::string &strError, bool fCheckCollateral) const |
bool | IsValidLocally (std::string &strError, bool &fMissingConfirmations, bool fCheckCollateral) const |
bool | IsCollateralValid (std::string &strError, bool &fMissingConfirmations) const |
Check the collateral transaction for the budget proposal/finalized budget. More... | |
void | UpdateLocalValidity () |
void | UpdateSentinelVariables () |
void | PrepareDeletion (int64_t nDeletionTime_) |
CAmount | GetMinCollateralFee () const |
UniValue | GetJSONObject () |
Return the actual object from the vchData JSON structure. More... | |
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 |
Get specific vote counts for each outcome (funding, validity, etc) More... | |
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) const |
std::string | GetDataAsHexString () const |
GetData - AsMore... | |
std::string | GetDataAsPlainString () const |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action) |
void | LoadData () |
LoadDataMore... | |
void | GetData (UniValue &objResult) |
GetData - Example usage:More... | |
bool | ProcessVote (CNode *pfrom, const CGovernanceVote &vote, CGovernanceException &exception, CConnman &connman) |
void | ClearMasternodeVotes () |
Called when MN's which have voted on this object have been removed. More... | |
std::set< uint256 > | RemoveInvalidVotes (const COutPoint &mnOutpoint) |
Static Public Member Functions | |
static bool | IsValidBlockHeight (int nBlockHeight) |
Is Valid Superblock Height. More... | |
static void | GetNearestSuperblocksHeights (int nBlockHeight, int &nLastSuperblockRet, int &nNextSuperblockRet) |
static CAmount | GetPaymentsLimit (int nBlockHeight) |
Private Member Functions | |
void | ParsePaymentSchedule (const std::string &strPaymentAddresses, const std::string &strPaymentAmounts) |
Private Attributes | |
uint256 | nGovObjHash |
int | nBlockHeight |
int | nStatus |
std::vector< CGovernancePayment > | vecPayments |
Additional Inherited Members | |
Public Types inherited from CGovernanceObject | |
typedef std::map< COutPoint, vote_rec_t > | vote_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_t > | vote_cmm_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 131 of file governance-classes.h.
Constructor & Destructor Documentation
◆ CSuperblock() [1/2]
CSuperblock::CSuperblock | ( | ) |
Definition at line 389 of file governance-classes.cpp.
◆ CSuperblock() [2/2]
|
explicit |
Definition at line 398 of file governance-classes.cpp.
References UniValue::get_int(), UniValue::get_str(), CGovernanceObject::GetDataAsPlainString(), GetGovernanceObject(), CGovernanceObject::GetJSONObject(), CGovernanceObject::GetObjectType(), BCLog::GOBJECT, GOVERNANCE_OBJECT_TRIGGER, LogPrint, nBlockHeight, ParsePaymentSchedule(), and vecPayments.
Member Function Documentation
◆ CountPayments()
|
inline |
Definition at line 168 of file governance-classes.h.
References vecPayments.
Referenced by GetPaymentsTotalAmount(), and IsValid().
◆ GetBlockHeight()
|
inline |
Definition at line 163 of file governance-classes.h.
References nBlockHeight.
◆ GetGovernanceObject()
|
inline |
Definition at line 156 of file governance-classes.h.
References AssertLockHeld(), CGovernanceManager::cs, CGovernanceManager::FindGovernanceObject(), governance, and nGovObjHash.
Referenced by CSuperblock(), and IsValid().
◆ GetNearestSuperblocksHeights()
|
static |
Definition at line 444 of file governance-classes.cpp.
References CChainParams::GetConsensus(), nBlockHeight, Consensus::Params::nSuperblockCycle, Consensus::Params::nSuperblockStartBlock, and Params().
Referenced by getgovernanceinfo().
◆ GetPayment()
bool CSuperblock::GetPayment | ( | int | nPaymentIndex, |
CGovernancePayment & | paymentRet | ||
) |
Definition at line 552 of file governance-classes.cpp.
References vecPayments.
Referenced by IsValid().
◆ GetPaymentsLimit()
|
static |
Definition at line 463 of file governance-classes.cpp.
References Consensus::Params::fPowAllowMinDifficultyBlocks, GetBlockSubsidy(), arith_uint256::GetCompact(), CChainParams::GetConsensus(), BCLog::GOBJECT, IsValidBlockHeight(), LogPrint, nBlockHeight, Consensus::Params::nSuperblockCycle, Params(), Consensus::Params::powLimit, and UintToArith256().
Referenced by getsuperblockbudget(), IsBlockValueValid(), and IsValid().
◆ GetPaymentsTotalAmount()
CAmount CSuperblock::GetPaymentsTotalAmount | ( | ) |
Definition at line 562 of file governance-classes.cpp.
References CountPayments(), and vecPayments.
Referenced by IsValid().
◆ GetStatus()
|
inline |
Definition at line 150 of file governance-classes.h.
References nStatus.
◆ IsExpired()
bool CSuperblock::IsExpired | ( | ) | const |
Definition at line 665 of file governance-classes.cpp.
References CGovernanceManager::GetCachedBlockHeight(), CChainParams::GetConsensus(), BCLog::GOBJECT, governance, LogPrint, nBlockHeight, nStatus, Consensus::Params::nSuperblockCycle, Params(), SEEN_OBJECT_EXECUTED, and SEEN_OBJECT_IS_VALID.
◆ IsValid()
bool CSuperblock::IsValid | ( | const CTransaction & | txNew, |
int | nBlockHeight, | ||
CAmount | blockReward | ||
) |
Is Transaction Valid.
- Does this transaction match the superblock?
Definition at line 580 of file governance-classes.cpp.
References CountPayments(), EncodeDestination(), ExtractDestination(), CGovernanceObject::GetDataAsHexString(), GetGovernanceObject(), GetPayment(), GetPaymentsLimit(), GetPaymentsTotalAmount(), CTransaction::GetValueOut(), BCLog::GOBJECT, IsValidBlockHeight(), LogPrint, LogPrintf, CGovernancePayment::nAmount, nBlockHeight, CGovernancePayment::script, and CTransaction::vout.
◆ IsValidBlockHeight()
|
static |
Is Valid Superblock Height.
- See if a block at this height can be a superblock
Definition at line 437 of file governance-classes.cpp.
References CChainParams::GetConsensus(), nBlockHeight, Consensus::Params::nSuperblockCycle, Consensus::Params::nSuperblockStartBlock, and Params().
Referenced by CSuperblockManager::GetBestSuperblock(), getblocktemplate(), GetPaymentsLimit(), IsBlockValueValid(), CSuperblockManager::IsSuperblockTriggered(), and IsValid().
◆ ParsePaymentSchedule()
|
private |
Definition at line 481 of file governance-classes.cpp.
References DecodeDestination(), EncodeDestination(), BCLog::GOBJECT, CGovernancePayment::IsValid(), IsValidDestination(), LogPrint, LogPrintf, ParsePaymentAmount(), SplitBy(), and vecPayments.
Referenced by CSuperblock().
◆ SetExecuted()
|
inline |
Definition at line 154 of file governance-classes.h.
References nStatus, and SEEN_OBJECT_EXECUTED.
◆ SetStatus()
|
inline |
Definition at line 151 of file governance-classes.h.
References nStatus.
Member Data Documentation
◆ nBlockHeight
|
private |
Definition at line 136 of file governance-classes.h.
Referenced by CSuperblock(), GetBlockHeight(), GetNearestSuperblocksHeights(), GetPaymentsLimit(), IsExpired(), IsValid(), and IsValidBlockHeight().
◆ nGovObjHash
|
private |
Definition at line 134 of file governance-classes.h.
Referenced by GetGovernanceObject().
◆ nStatus
|
private |
Definition at line 137 of file governance-classes.h.
Referenced by GetStatus(), IsExpired(), SetExecuted(), and SetStatus().
◆ vecPayments
|
private |
Definition at line 138 of file governance-classes.h.
Referenced by CountPayments(), CSuperblock(), GetPayment(), GetPaymentsTotalAmount(), and ParsePaymentSchedule().
The documentation for this class was generated from the following files:
- src/governance/governance-classes.h
- src/governance/governance-classes.cpp