PIVX Core  5.6.99
P2P Digital Currency
Public Member Functions | Static Public Member Functions | List of all members
CMasternodeBroadcast Class Reference

#include <masternode.h>

Inheritance diagram for CMasternodeBroadcast:
[legend]
Collaboration diagram for CMasternodeBroadcast:
[legend]

Public Member Functions

 CMasternodeBroadcast ()
 
 CMasternodeBroadcast (CService newAddr, CTxIn newVin, CPubKey newPubkey, CPubKey newPubkey2, int protocolVersionIn, const CMasternodePing &_lastPing)
 
 CMasternodeBroadcast (const CMasternode &mn)
 
bool CheckAndUpdate (int &nDoS)
 
uint256 GetHash () const
 
void Relay ()
 
bool Sign (const CKey &key, const CPubKey &pubKey)
 
bool CheckSignature () const
 
 SERIALIZE_METHODS (CMasternodeBroadcast, obj)
 
- Public Member Functions inherited from CMasternode
 CMasternode ()
 
 CMasternode (const CMasternode &other)
 
 CMasternode (const CDeterministicMNCPtr &dmn, int64_t registeredTime, const uint256 &registeredHash)
 
uint256 GetSignatureHash () const override
 
std::string GetStrMessage () const override
 
const CTxIn GetVin () const
 
CPubKey GetPubKey () const
 
void SetLastPing (const CMasternodePing &_lastPing)
 
CMasternodeoperator= (const CMasternode &other)
 
arith_uint256 CalculateScore (const uint256 &hash) const
 
 SERIALIZE_METHODS (CMasternode, obj)
 
template<typename Stream >
 CMasternode (deserialize_type, Stream &s)
 
bool UpdateFromNewBroadcast (CMasternodeBroadcast &mnb)
 
CMasternode::state GetActiveState () const
 
bool IsBroadcastedWithin (int seconds)
 
bool IsPingedWithin (int seconds, int64_t now=-1) const
 
void SetSpent ()
 
void Disable ()
 
bool IsEnabled () const
 
bool IsPreEnabled () const
 
bool IsAvailableState () const
 
std::string Status () const
 
bool IsValidNetAddr () const
 
CScript GetPayeeScript () const
 
- Public Member Functions inherited from CSignedMessage
 CSignedMessage ()
 
virtual ~CSignedMessage ()
 
bool Sign (const CKey &key, const CKeyID &keyID)
 CSignedMessage Class Functions inherited by network signed-messages. More...
 
bool Sign (const std::string strSignKey)
 
bool CheckSignature (const CKeyID &keyID) const
 
void SetVchSig (const std::vector< unsigned char > &vchSigIn)
 
std::vector< unsigned char > GetVchSig () const
 
std::string GetSignatureBase64 () const
 
bool Sign (const CBLSSecretKey &sk)
 
bool CheckSignature (const CBLSPublicKey &pk) const
 

Static Public Member Functions

static bool Create (const CTxIn &vin, 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 (const std::string &strService, const std::string &strKey, const std::string &strTxHash, const std::string &strOutputIndex, std::string &strErrorRet, CMasternodeBroadcast &mnbRet, bool fOffline, int chainHeight)
 
static bool CheckDefaultPort (CService service, std::string &strErrorRet, const std::string &strContext)
 

Additional Inherited Members

- Public Types inherited from CMasternode
enum  state {
  MASTERNODE_PRE_ENABLED , MASTERNODE_ENABLED , MASTERNODE_EXPIRED , MASTERNODE_REMOVE ,
  MASTERNODE_VIN_SPENT
}
 
- Public Attributes inherited from CMasternode
CTxIn vin
 
CService addr
 
CPubKey pubKeyCollateralAddress
 
CPubKey pubKeyMasternode
 
int64_t sigTime
 
int protocolVersion
 
int nScanningErrorCount
 
int nLastScanningErrorBlockHeight
 
CMasternodePing lastPing
 
CScript mnPayeeScript {}
 
- Public Attributes inherited from CSignedMessage
int nMessVersion
 
- Protected Attributes inherited from CSignedMessage
std::vector< unsigned char > vchSig
 

Detailed Description

Definition at line 242 of file masternode.h.

Constructor & Destructor Documentation

◆ CMasternodeBroadcast() [1/3]

CMasternodeBroadcast::CMasternodeBroadcast ( )

Definition at line 201 of file masternode.cpp.

Here is the caller graph for this function:

◆ CMasternodeBroadcast() [2/3]

CMasternodeBroadcast::CMasternodeBroadcast ( CService  newAddr,
CTxIn  newVin,
CPubKey  newPubkey,
CPubKey  newPubkey2,
int  protocolVersionIn,
const CMasternodePing _lastPing 
)

Definition at line 205 of file masternode.cpp.

◆ CMasternodeBroadcast() [3/3]

CMasternodeBroadcast::CMasternodeBroadcast ( const CMasternode mn)
explicit

Definition at line 217 of file masternode.cpp.

Member Function Documentation

◆ CheckAndUpdate()

bool CMasternodeBroadcast::CheckAndUpdate ( int &  nDoS)

Definition at line 382 of file masternode.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckDefaultPort()

bool CMasternodeBroadcast::CheckDefaultPort ( CService  service,
std::string &  strErrorRet,
const std::string &  strContext 
)
static

Definition at line 368 of file masternode.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckSignature()

bool CMasternodeBroadcast::CheckSignature ( ) const

Definition at line 353 of file masternode.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create() [1/2]

bool CMasternodeBroadcast::Create ( const CTxIn vin,
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.

Todo:
: move outside of this function)

Definition at line 290 of file masternode.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create() [2/2]

bool CMasternodeBroadcast::Create ( const std::string &  strService,
const std::string &  strKey,
const std::string &  strTxHash,
const std::string &  strOutputIndex,
std::string &  strErrorRet,
CMasternodeBroadcast mnbRet,
bool  fOffline,
int  chainHeight 
)
static

Definition at line 221 of file masternode.cpp.

Here is the call graph for this function:

◆ GetHash()

uint256 CMasternodeBroadcast::GetHash ( ) const

Definition at line 481 of file masternode.cpp.

Here is the caller graph for this function:

◆ Relay()

void CMasternodeBroadcast::Relay ( )

Definition at line 475 of file masternode.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SERIALIZE_METHODS()

CMasternodeBroadcast::SERIALIZE_METHODS ( CMasternodeBroadcast  ,
obj   
)
inline

Definition at line 259 of file masternode.h.

◆ Sign()

bool CMasternodeBroadcast::Sign ( const CKey key,
const CPubKey pubKey 
)

Definition at line 335 of file masternode.cpp.

Here is the call graph for this function:

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