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

#include <masternodeman.h>

Collaboration diagram for CMasternodeMan:
[legend]

Public Member Functions

template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action, int nType, int nVersion)
 
 CMasternodeMan ()
 
 CMasternodeMan (CMasternodeMan &other)
 
bool Add (CMasternode &mn)
 Add an entry. More...
 
void AskForMN (CNode *pnode, CTxIn &vin)
 Ask (source) node for mnb. More...
 
void Check ()
 Check all Masternodes. More...
 
void CheckAndRemove (bool forceExpiredRemoval=false)
 Check all Masternodes and remove inactive. More...
 
void Clear ()
 Clear Masternode vector. More...
 
int CountEnabled (int protocolVersion=-1)
 
void CountNetworks (int protocolVersion, int &ipv4, int &ipv6, int &onion)
 
void DsegUpdate (CNode *pnode)
 
CMasternodeFind (const CScript &payee)
 Find an entry. More...
 
CMasternodeFind (const CTxIn &vin)
 
CMasternodeFind (const CPubKey &pubKeyMasternode)
 
CMasternodeGetNextMasternodeInQueueForPayment (int nBlockHeight, bool fFilterSigTime, int &nCount)
 Find an entry in the masternode list that is next to be paid. More...
 
CMasternodeGetCurrentMasterNode (int mod=1, int64_t nBlockHeight=0, int minProtocol=0)
 Get the current winner for this block. More...
 
std::vector< CMasternodeGetFullMasternodeVector ()
 
std::vector< std::pair< int, CMasternode > > GetMasternodeRanks (int64_t nBlockHeight, int minProtocol=0)
 
int GetMasternodeRank (const CTxIn &vin, int64_t nBlockHeight, int minProtocol=0, bool fOnlyActive=true)
 
CMasternodeGetMasternodeByRank (int nRank, int64_t nBlockHeight, int minProtocol=0, bool fOnlyActive=true)
 
void ProcessMessage (CNode *pfrom, std::string &strCommand, CDataStream &vRecv)
 
int size ()
 Return the number of (unique) Masternodes. More...
 
int stable_size ()
 Return the number of Masternodes older than (default) 8000 seconds. More...
 
std::string ToString () const
 
void Remove (CTxIn vin)
 
void UpdateMasternodeList (CMasternodeBroadcast mnb)
 Update masternode list and maps using provided CMasternodeBroadcast. More...
 

Public Attributes

std::map< uint256, CMasternodeBroadcastmapSeenMasternodeBroadcast
 
std::map< uint256, CMasternodePingmapSeenMasternodePing
 
int64_t nDsqCount
 
 ADD_SERIALIZE_METHODS
 

Private Attributes

RecursiveMutex cs
 
RecursiveMutex cs_process_message
 
std::vector< CMasternodevMasternodes
 
std::map< CNetAddr, int64_t > mAskedUsForMasternodeList
 
std::map< CNetAddr, int64_t > mWeAskedForMasternodeList
 
std::map< COutPoint, int64_t > mWeAskedForMasternodeListEntry
 

Detailed Description

Definition at line 56 of file masternodeman.h.

Constructor & Destructor Documentation

◆ CMasternodeMan() [1/2]

CMasternodeMan::CMasternodeMan ( )

Definition at line 201 of file masternodeman.cpp.

◆ CMasternodeMan() [2/2]

CMasternodeMan::CMasternodeMan ( CMasternodeMan other)

Member Function Documentation

◆ Add()

bool CMasternodeMan::Add ( CMasternode mn)

Add an entry.

Definition at line 206 of file masternodeman.cpp.

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

◆ AskForMN()

void CMasternodeMan::AskForMN ( CNode pnode,
CTxIn vin 
)

Ask (source) node for mnb.

Definition at line 223 of file masternodeman.cpp.

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

◆ Check()

void CMasternodeMan::Check ( )

Check all Masternodes.

Definition at line 241 of file masternodeman.cpp.

Here is the caller graph for this function:

◆ CheckAndRemove()

void CMasternodeMan::CheckAndRemove ( bool  forceExpiredRemoval = false)

Check all Masternodes and remove inactive.

Definition at line 250 of file masternodeman.cpp.

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

◆ Clear()

void CMasternodeMan::Clear ( )

Clear Masternode vector.

Definition at line 346 of file masternodeman.cpp.

◆ CountEnabled()

int CMasternodeMan::CountEnabled ( int  protocolVersion = -1)

Definition at line 379 of file masternodeman.cpp.

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

◆ CountNetworks()

void CMasternodeMan::CountNetworks ( int  protocolVersion,
int &  ipv4,
int &  ipv6,
int &  onion 
)

Definition at line 393 of file masternodeman.cpp.

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

◆ DsegUpdate()

void CMasternodeMan::DsegUpdate ( CNode pnode)

Definition at line 419 of file masternodeman.cpp.

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

◆ Find() [1/3]

CMasternode * CMasternodeMan::Find ( const CPubKey pubKeyMasternode)

Definition at line 465 of file masternodeman.cpp.

◆ Find() [2/3]

CMasternode * CMasternodeMan::Find ( const CScript payee)

Find an entry.

Definition at line 440 of file masternodeman.cpp.

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

◆ Find() [3/3]

CMasternode * CMasternodeMan::Find ( const CTxIn vin)

Definition at line 453 of file masternodeman.cpp.

◆ GetCurrentMasterNode()

CMasternode * CMasternodeMan::GetCurrentMasterNode ( int  mod = 1,
int64_t  nBlockHeight = 0,
int  minProtocol = 0 
)

Get the current winner for this block.

Definition at line 540 of file masternodeman.cpp.

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

◆ GetFullMasternodeVector()

std::vector<CMasternode> CMasternodeMan::GetFullMasternodeVector ( )
inline

Definition at line 135 of file masternodeman.h.

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

◆ GetMasternodeByRank()

CMasternode * CMasternodeMan::GetMasternodeByRank ( int  nRank,
int64_t  nBlockHeight,
int  minProtocol = 0,
bool  fOnlyActive = true 
)

Definition at line 641 of file masternodeman.cpp.

Here is the call graph for this function:

◆ GetMasternodeRank()

int CMasternodeMan::GetMasternodeRank ( const CTxIn vin,
int64_t  nBlockHeight,
int  minProtocol = 0,
bool  fOnlyActive = true 
)

Definition at line 564 of file masternodeman.cpp.

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

◆ GetMasternodeRanks()

std::vector< std::pair< int, CMasternode > > CMasternodeMan::GetMasternodeRanks ( int64_t  nBlockHeight,
int  minProtocol = 0 
)

Definition at line 604 of file masternodeman.cpp.

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

◆ GetNextMasternodeInQueueForPayment()

CMasternode * CMasternodeMan::GetNextMasternodeInQueueForPayment ( int  nBlockHeight,
bool  fFilterSigTime,
int &  nCount 
)

Find an entry in the masternode list that is next to be paid.

Definition at line 479 of file masternodeman.cpp.

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

◆ ProcessMessage()

void CMasternodeMan::ProcessMessage ( CNode pfrom,
std::string &  strCommand,
CDataStream vRecv 
)

Definition at line 672 of file masternodeman.cpp.

Here is the call graph for this function:

◆ Remove()

void CMasternodeMan::Remove ( CTxIn  vin)

Definition at line 804 of file masternodeman.cpp.

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

◆ SerializationOp()

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

Definition at line 87 of file masternodeman.h.

◆ size()

int CMasternodeMan::size ( )
inline

Return the number of (unique) Masternodes.

Definition at line 148 of file masternodeman.h.

Here is the caller graph for this function:

◆ stable_size()

int CMasternodeMan::stable_size ( )

Return the number of Masternodes older than (default) 8000 seconds.

Definition at line 358 of file masternodeman.cpp.

Here is the call graph for this function:

◆ ToString()

std::string CMasternodeMan::ToString ( ) const

Definition at line 838 of file masternodeman.cpp.

◆ UpdateMasternodeList()

void CMasternodeMan::UpdateMasternodeList ( CMasternodeBroadcast  mnb)

Update masternode list and maps using provided CMasternodeBroadcast.

Definition at line 819 of file masternodeman.cpp.

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

Member Data Documentation

◆ ADD_SERIALIZE_METHODS

CMasternodeMan::ADD_SERIALIZE_METHODS

Definition at line 84 of file masternodeman.h.

◆ cs

RecursiveMutex CMasternodeMan::cs
mutableprivate

Definition at line 60 of file masternodeman.h.

◆ cs_process_message

RecursiveMutex CMasternodeMan::cs_process_message
mutableprivate

Definition at line 63 of file masternodeman.h.

◆ mapSeenMasternodeBroadcast

std::map<uint256, CMasternodeBroadcast> CMasternodeMan::mapSeenMasternodeBroadcast

Definition at line 76 of file masternodeman.h.

◆ mapSeenMasternodePing

std::map<uint256, CMasternodePing> CMasternodeMan::mapSeenMasternodePing

Definition at line 78 of file masternodeman.h.

◆ mAskedUsForMasternodeList

std::map<CNetAddr, int64_t> CMasternodeMan::mAskedUsForMasternodeList
private

Definition at line 68 of file masternodeman.h.

◆ mWeAskedForMasternodeList

std::map<CNetAddr, int64_t> CMasternodeMan::mWeAskedForMasternodeList
private

Definition at line 70 of file masternodeman.h.

◆ mWeAskedForMasternodeListEntry

std::map<COutPoint, int64_t> CMasternodeMan::mWeAskedForMasternodeListEntry
private

Definition at line 72 of file masternodeman.h.

◆ nDsqCount

int64_t CMasternodeMan::nDsqCount
Todo:
: Remove this from serialization

Definition at line 82 of file masternodeman.h.

◆ vMasternodes

std::vector<CMasternode> CMasternodeMan::vMasternodes
private

Definition at line 66 of file masternodeman.h.


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