Dash Core  0.12.2.1
P2P Digital Currency
CMasternodeBroadcast Class Reference

#include <masternode.h>

+ Inheritance diagram for CMasternodeBroadcast:

Public Member Functions

 CMasternodeBroadcast ()
 
 CMasternodeBroadcast (const CMasternode &mn)
 
 CMasternodeBroadcast (CService addrNew, COutPoint outpointNew, CPubKey pubKeyCollateralAddressNew, CPubKey pubKeyMasternodeNew, int nProtocolVersionIn)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action, int nType, int nVersion)
 
uint256 GetHash () const
 
bool SimpleCheck (int &nDos)
 
bool Update (CMasternode *pmn, int &nDos, CConnman &connman)
 
bool CheckOutpoint (int &nDos)
 
bool Sign (const CKey &keyCollateralAddress)
 
bool CheckSignature (int &nDos)
 
void Relay (CConnman &connman)
 
- Public Member Functions inherited from CMasternode
 CMasternode ()
 
 CMasternode (const CMasternode &other)
 
 CMasternode (const CMasternodeBroadcast &mnb)
 
 CMasternode (CService addrNew, COutPoint outpointNew, CPubKey pubKeyCollateralAddressNew, CPubKey pubKeyMasternodeNew, int nProtocolVersionIn)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action, int nType, int nVersion)
 
arith_uint256 CalculateScore (const uint256 &blockHash)
 
bool UpdateFromNewBroadcast (CMasternodeBroadcast &mnb, CConnman &connman)
 
void Check (bool fForce=false)
 
bool IsBroadcastedWithin (int nSeconds)
 
bool IsPingedWithin (int nSeconds, int64_t nTimeToCheckAt=-1)
 
bool IsEnabled ()
 
bool IsPreEnabled ()
 
bool IsPoSeBanned ()
 
bool IsPoSeVerified ()
 
bool IsExpired ()
 
bool IsOutpointSpent ()
 
bool IsUpdateRequired ()
 
bool IsWatchdogExpired ()
 
bool IsNewStartRequired ()
 
bool IsValidForPayment ()
 
bool IsInputAssociatedWithPubkey ()
 Is the input associated with collateral public key? (and there is 1000 DASH - checking if valid masternode) More...
 
bool IsValidNetAddr ()
 
void IncreasePoSeBanScore ()
 
void DecreasePoSeBanScore ()
 
void PoSeBan ()
 
masternode_info_t GetInfo ()
 
std::string GetStateString () const
 
std::string GetStatus () const
 
int GetLastPaidTime ()
 
int GetLastPaidBlock ()
 
void UpdateLastPaid (const CBlockIndex *pindex, int nMaxBlocksToScanBack)
 
void AddGovernanceVote (uint256 nGovernanceObjectHash)
 
void FlagGovernanceItemsAsDirty ()
 
void RemoveGovernanceObject (uint256 nGovernanceObjectHash)
 
void UpdateWatchdogVoteTime (uint64_t nVoteTime=0)
 
CMasternodeoperator= (CMasternode const &from)
 
- Public Member Functions inherited from masternode_info_t
 masternode_info_t ()=default
 
 masternode_info_t (masternode_info_t const &)=default
 
 masternode_info_t (int activeState, int protoVer, int64_t sTime)
 
 masternode_info_t (int activeState, int protoVer, int64_t sTime, COutPoint const &outpoint, CService const &addr, CPubKey const &pkCollAddr, CPubKey const &pkMN, int64_t tWatchdogV=0)
 

Static Public Member Functions

static bool Create (const COutPoint &outpoint, const CService &service, const CKey &keyCollateralAddressNew, const CPubKey &pubKeyCollateralAddressNew, const CKey &keyMasternodeNew, const CPubKey &pubKeyMasternodeNew, std::string &strErrorRet, CMasternodeBroadcast &mnbRet)
 Create Masternode broadcast, needs to be relayed manually after that. More...
 
static bool Create (std::string strService, std::string strKey, std::string strTxHash, std::string strOutputIndex, std::string &strErrorRet, CMasternodeBroadcast &mnbRet, bool fOffline=false)
 
- Static Public Member Functions inherited from CMasternode
static CollateralStatus CheckCollateral (const COutPoint &outpoint)
 
static CollateralStatus CheckCollateral (const COutPoint &outpoint, int &nHeightRet)
 
static bool IsValidStateForAutoStart (int nActiveStateIn)
 
static bool IsValidNetAddr (CService addrIn)
 
static std::string StateToString (int nStateIn)
 

Public Attributes

bool fRecovery
 
 ADD_SERIALIZE_METHODS
 
- Public Attributes inherited from CMasternode
CMasternodePing lastPing {}
 
std::vector< unsigned char > vchSig {}
 
uint256 nCollateralMinConfBlockHash {}
 
int nBlockLastPaid {}
 
int nPoSeBanScore {}
 
int nPoSeBanHeight {}
 
bool fAllowMixingTx {}
 
bool fUnitTest = false
 
std::map< uint256, int > mapGovernanceObjectsVotedOn
 
 ADD_SERIALIZE_METHODS
 
- Public Attributes inherited from masternode_info_t
int nActiveState = 0
 
int nProtocolVersion = 0
 
int64_t sigTime = 0
 
CTxIn vin {}
 
CService addr {}
 
CPubKey pubKeyCollateralAddress {}
 
CPubKey pubKeyMasternode {}
 
int64_t nTimeLastWatchdogVote = 0
 
int64_t nLastDsq = 0
 
int64_t nTimeLastChecked = 0
 
int64_t nTimeLastPaid = 0
 
int64_t nTimeLastPing = 0
 
bool fInfoValid = false
 

Additional Inherited Members

- Public Types inherited from CMasternode
enum  state {
  MASTERNODE_PRE_ENABLED, MASTERNODE_ENABLED, MASTERNODE_EXPIRED, MASTERNODE_OUTPOINT_SPENT,
  MASTERNODE_UPDATE_REQUIRED, MASTERNODE_WATCHDOG_EXPIRED, MASTERNODE_NEW_START_REQUIRED, MASTERNODE_POSE_BAN
}
 
enum  CollateralStatus { COLLATERAL_OK, COLLATERAL_UTXO_NOT_FOUND, COLLATERAL_INVALID_AMOUNT }
 

Detailed Description

Definition at line 313 of file masternode.h.

Constructor & Destructor Documentation

◆ CMasternodeBroadcast() [1/3]

CMasternodeBroadcast::CMasternodeBroadcast ( )
inline

Definition at line 319 of file masternode.h.

Referenced by Create().

◆ CMasternodeBroadcast() [2/3]

CMasternodeBroadcast::CMasternodeBroadcast ( const CMasternode mn)
inline

Definition at line 320 of file masternode.h.

◆ CMasternodeBroadcast() [3/3]

CMasternodeBroadcast::CMasternodeBroadcast ( CService  addrNew,
COutPoint  outpointNew,
CPubKey  pubKeyCollateralAddressNew,
CPubKey  pubKeyMasternodeNew,
int  nProtocolVersionIn 
)
inline

Definition at line 321 of file masternode.h.

Member Function Documentation

◆ CheckOutpoint()

bool CMasternodeBroadcast::CheckOutpoint ( int &  nDos)

Definition at line 543 of file masternode.cpp.

Referenced by CMasternodeMan::CheckMnbAndUpdateMasternodeList().

◆ CheckSignature()

bool CMasternodeBroadcast::CheckSignature ( int &  nDos)

Definition at line 644 of file masternode.cpp.

Referenced by CheckOutpoint(), masternodebroadcast(), and Update().

◆ Create() [1/2]

bool CMasternodeBroadcast::Create ( const COutPoint outpoint,
const CService service,
const CKey keyCollateralAddressNew,
const CPubKey pubKeyCollateralAddressNew,
const CKey keyMasternodeNew,
const CPubKey pubKeyMasternodeNew,
std::string &  strErrorRet,
CMasternodeBroadcast mnbRet 
)
static

Create Masternode broadcast, needs to be relayed manually after that.

Definition at line 397 of file masternode.cpp.

Referenced by Create(), CActiveMasternode::ManageStateLocal(), masternode(), masternodebroadcast(), MasternodeList::StartAlias(), and MasternodeList::StartAll().

◆ Create() [2/2]

bool CMasternodeBroadcast::Create ( std::string  strService,
std::string  strKey,
std::string  strTxHash,
std::string  strOutputIndex,
std::string &  strErrorRet,
CMasternodeBroadcast mnbRet,
bool  fOffline = false 
)
static

Definition at line 359 of file masternode.cpp.

◆ GetHash()

◆ Relay()

◆ SerializationOp()

template<typename Stream , typename Operation >
void CMasternodeBroadcast::SerializationOp ( Stream &  s,
Operation  ser_action,
int  nType,
int  nVersion 
)
inline

Definition at line 327 of file masternode.h.

◆ Sign()

bool CMasternodeBroadcast::Sign ( const CKey keyCollateralAddress)

Definition at line 620 of file masternode.cpp.

Referenced by Create().

◆ SimpleCheck()

bool CMasternodeBroadcast::SimpleCheck ( int &  nDos)

Definition at line 430 of file masternode.cpp.

Referenced by CMasternodeMan::CheckMnbAndUpdateMasternodeList().

◆ Update()

bool CMasternodeBroadcast::Update ( CMasternode pmn,
int &  nDos,
CConnman connman 
)

Definition at line 491 of file masternode.cpp.

Referenced by CMasternodeMan::CheckMnbAndUpdateMasternodeList().

Member Data Documentation

◆ ADD_SERIALIZE_METHODS

CMasternodeBroadcast::ADD_SERIALIZE_METHODS

Definition at line 324 of file masternode.h.

◆ fRecovery

bool CMasternodeBroadcast::fRecovery

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