PRCYCoin  2.0.0.7rc1
P2P Digital Currency
Public Types | Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
CMasternode Class Reference

#include <masternode.h>

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

Public Types

enum  state {
  MASTERNODE_PRE_ENABLED, MASTERNODE_ENABLED, MASTERNODE_EXPIRED, MASTERNODE_OUTPOINT_SPENT,
  MASTERNODE_REMOVE, MASTERNODE_WATCHDOG_EXPIRED, MASTERNODE_POSE_BAN, MASTERNODE_VIN_SPENT,
  MASTERNODE_POS_ERROR
}
 

Public Member Functions

 CMasternode ()
 
 CMasternode (const CMasternode &other)
 
 CMasternode (const CMasternodeBroadcast &mnb)
 
void swap (CMasternode &first, CMasternode &second)
 
CMasternodeoperator= (CMasternode from)
 
uint256 CalculateScore (int mod=1, int64_t nBlockHeight=0)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action, int nType, int nVersion)
 
int64_t SecondsSincePayment ()
 
bool UpdateFromNewBroadcast (CMasternodeBroadcast &mnb)
 
void Check (bool forceCheck=false)
 
bool IsBroadcastedWithin (int seconds)
 
bool IsPingedWithin (int seconds, int64_t now=-1)
 
void Disable ()
 
bool IsEnabled ()
 
int GetMasternodeInputAge ()
 
std::string GetStatus ()
 
std::string Status ()
 
int64_t GetLastPaid ()
 
bool IsValidNetAddr ()
 
bool IsInputAssociatedWithPubkey (CTxIn &vin, CPubKey &pubkey) const
 Is the input associated with collateral public key? (and there is 5000 PRCY - checking if valid masternode) More...
 

Public Attributes

CTxIn vin
 
CService addr
 
CPubKey pubKeyCollateralAddress
 
CPubKey pubKeyMasternode
 
CPubKey pubKeyCollateralAddress1
 
CPubKey pubKeyMasternode1
 
std::vector< unsigned char > sig
 
int activeState
 
int64_t sigTime
 
int cacheInputAge
 
int cacheInputAgeBlock
 
bool unitTest
 
bool allowFreeTx
 
int protocolVersion
 
int nActiveState
 
int64_t nLastDsq
 
int nScanningErrorCount
 
int nLastScanningErrorBlockHeight
 
CMasternodePing lastPing
 
 ADD_SERIALIZE_METHODS
 

Private Attributes

RecursiveMutex cs
 
int64_t lastTimeChecked
 

Friends

bool operator== (const CMasternode &a, const CMasternode &b)
 
bool operator!= (const CMasternode &a, const CMasternode &b)
 

Detailed Description

Definition at line 107 of file masternode.h.

Member Enumeration Documentation

◆ state

Enumerator
MASTERNODE_PRE_ENABLED 
MASTERNODE_ENABLED 
MASTERNODE_EXPIRED 
MASTERNODE_OUTPOINT_SPENT 
MASTERNODE_REMOVE 
MASTERNODE_WATCHDOG_EXPIRED 
MASTERNODE_POSE_BAN 
MASTERNODE_VIN_SPENT 
MASTERNODE_POS_ERROR 

Definition at line 115 of file masternode.h.

Constructor & Destructor Documentation

◆ CMasternode() [1/3]

CMasternode::CMasternode ( )

Definition at line 74 of file masternode.cpp.

Here is the call graph for this function:

◆ CMasternode() [2/3]

CMasternode::CMasternode ( const CMasternode other)

Definition at line 97 of file masternode.cpp.

◆ CMasternode() [3/3]

CMasternode::CMasternode ( const CMasternodeBroadcast mnb)

Definition at line 120 of file masternode.cpp.

Member Function Documentation

◆ CalculateScore()

uint256 CMasternode::CalculateScore ( int  mod = 1,
int64_t  nBlockHeight = 0 
)

Definition at line 171 of file masternode.cpp.

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

◆ Check()

void CMasternode::Check ( bool  forceCheck = false)

Definition at line 200 of file masternode.cpp.

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

◆ Disable()

void CMasternode::Disable ( )
inline

Definition at line 236 of file masternode.h.

◆ GetLastPaid()

int64_t CMasternode::GetLastPaid ( )

Definition at line 259 of file masternode.cpp.

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

◆ GetMasternodeInputAge()

int CMasternode::GetMasternodeInputAge ( )
inline

Definition at line 247 of file masternode.h.

Here is the call graph for this function:

◆ GetStatus()

std::string CMasternode::GetStatus ( )

Definition at line 307 of file masternode.cpp.

Here is the caller graph for this function:

◆ IsBroadcastedWithin()

bool CMasternode::IsBroadcastedWithin ( int  seconds)
inline

Definition at line 224 of file masternode.h.

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

◆ IsEnabled()

bool CMasternode::IsEnabled ( )
inline

Definition at line 242 of file masternode.h.

Here is the caller graph for this function:

◆ IsInputAssociatedWithPubkey()

bool CMasternode::IsInputAssociatedWithPubkey ( CTxIn vin,
CPubKey pubkey 
) const

Is the input associated with collateral public key? (and there is 5000 PRCY - checking if valid masternode)

Definition at line 337 of file masternode.cpp.

Here is the call graph for this function:

◆ IsPingedWithin()

bool CMasternode::IsPingedWithin ( int  seconds,
int64_t  now = -1 
)
inline

Definition at line 229 of file masternode.h.

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

◆ IsValidNetAddr()

bool CMasternode::IsValidNetAddr ( )
Todo:
: regtest is fine with any addresses for now,

Definition at line 329 of file masternode.cpp.

Here is the call graph for this function:

◆ operator=()

CMasternode& CMasternode::operator= ( CMasternode  from)
inline

Definition at line 177 of file masternode.h.

Here is the call graph for this function:

◆ SecondsSincePayment()

int64_t CMasternode::SecondsSincePayment ( )

Definition at line 241 of file masternode.cpp.

Here is the call graph for this function:

◆ SerializationOp()

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

Definition at line 196 of file masternode.h.

◆ Status()

std::string CMasternode::Status ( )
inline

Definition at line 267 of file masternode.h.

Here is the caller graph for this function:

◆ swap()

void CMasternode::swap ( CMasternode first,
CMasternode second 
)
inline

Definition at line 152 of file masternode.h.

Here is the caller graph for this function:

◆ UpdateFromNewBroadcast()

bool CMasternode::UpdateFromNewBroadcast ( CMasternodeBroadcast mnb)

Definition at line 146 of file masternode.cpp.

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

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const CMasternode a,
const CMasternode b 
)
friend

Definition at line 186 of file masternode.h.

◆ operator==

bool operator== ( const CMasternode a,
const CMasternode b 
)
friend

Definition at line 182 of file masternode.h.

Member Data Documentation

◆ activeState

int CMasternode::activeState

Definition at line 134 of file masternode.h.

◆ ADD_SERIALIZE_METHODS

CMasternode::ADD_SERIALIZE_METHODS

Definition at line 193 of file masternode.h.

◆ addr

CService CMasternode::addr

Definition at line 128 of file masternode.h.

◆ allowFreeTx

bool CMasternode::allowFreeTx

Definition at line 139 of file masternode.h.

◆ cacheInputAge

int CMasternode::cacheInputAge

Definition at line 136 of file masternode.h.

◆ cacheInputAgeBlock

int CMasternode::cacheInputAgeBlock

Definition at line 137 of file masternode.h.

◆ cs

RecursiveMutex CMasternode::cs
mutableprivate

Definition at line 111 of file masternode.h.

◆ lastPing

CMasternodePing CMasternode::lastPing

Definition at line 145 of file masternode.h.

◆ lastTimeChecked

int64_t CMasternode::lastTimeChecked
private

Definition at line 112 of file masternode.h.

◆ nActiveState

int CMasternode::nActiveState

Definition at line 141 of file masternode.h.

◆ nLastDsq

int64_t CMasternode::nLastDsq

Definition at line 142 of file masternode.h.

◆ nLastScanningErrorBlockHeight

int CMasternode::nLastScanningErrorBlockHeight

Definition at line 144 of file masternode.h.

◆ nScanningErrorCount

int CMasternode::nScanningErrorCount

Definition at line 143 of file masternode.h.

◆ protocolVersion

int CMasternode::protocolVersion

Definition at line 140 of file masternode.h.

◆ pubKeyCollateralAddress

CPubKey CMasternode::pubKeyCollateralAddress

Definition at line 129 of file masternode.h.

◆ pubKeyCollateralAddress1

CPubKey CMasternode::pubKeyCollateralAddress1

Definition at line 131 of file masternode.h.

◆ pubKeyMasternode

CPubKey CMasternode::pubKeyMasternode

Definition at line 130 of file masternode.h.

◆ pubKeyMasternode1

CPubKey CMasternode::pubKeyMasternode1

Definition at line 132 of file masternode.h.

◆ sig

std::vector<unsigned char> CMasternode::sig

Definition at line 133 of file masternode.h.

◆ sigTime

int64_t CMasternode::sigTime

Definition at line 135 of file masternode.h.

◆ unitTest

bool CMasternode::unitTest

Definition at line 138 of file masternode.h.

◆ vin

CTxIn CMasternode::vin

Definition at line 127 of file masternode.h.


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