![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
#include <masternodeman.h>
Classes | |
| struct | MNsInfo |
Public Member Functions | |
| SERIALIZE_METHODS (CMasternodeMan, obj) | |
| CMasternodeMan () | |
| bool | Add (CMasternode &mn) |
| Add an entry. More... | |
| void | AskForMN (CNode *pnode, const CTxIn &vin) |
| Ask (source) node for mnb. More... | |
| int | CheckAndRemove (bool forceExpiredRemoval=false) |
| Check all Masternodes and remove inactive. Return the total masternode count. More... | |
| void | Clear () |
| Clear Masternode vector. More... | |
| void | SetBestHeight (int height) |
| int | GetBestHeight () const |
| int | CountEnabled (bool only_legacy=false) const |
| bool | RequestMnList (CNode *pnode) |
| CMasternode * | Find (const COutPoint &collateralOut) |
| Find an entry. More... | |
| const CMasternode * | Find (const COutPoint &collateralOut) const |
| CMasternode * | Find (const CPubKey &pubKeyMasternode) |
| void | CheckSpentCollaterals (const std::vector< CTransactionRef > &vtx) |
| Check all transactions in a block, for spent masternode collateral outpoints (marking them as spent) More... | |
| MasternodeRef | GetNextMasternodeInQueueForPayment (int nBlockHeight, bool fFilterSigTime, int &nCount, const CBlockIndex *pChainTip=nullptr) const |
| Find an entry in the masternode list that is next to be paid. More... | |
| MasternodeRef | GetCurrentMasterNode (const uint256 &hash) const |
| Get the winner for this block hash. More... | |
| std::vector< std::pair< MasternodeRef, int > > | GetMnScores (int nLast) const |
| vector of pairs <masternode winner, height> More... | |
| std::vector< std::pair< int64_t, MasternodeRef > > | GetMasternodeRanks (int nBlockHeight) const |
| int | GetMasternodeRank (const CTxIn &vin, int64_t nBlockHeight) const |
| bool | ProcessMessage (CNode *pfrom, std::string &strCommand, CDataStream &vRecv, int &dosScore) |
| int | ProcessGetMNList (CNode *pfrom, CTxIn &vin) |
| CMasternodeMan::MNsInfo | getMNsInfo () const |
| std::string | ToString () const |
| void | Remove (const COutPoint &collateralOut) |
| void | UpdateMasternodeList (CMasternodeBroadcast &mnb) |
| Update masternode list and maps using provided CMasternodeBroadcast. More... | |
| int64_t | GetLastPaid (const MasternodeRef &mn, int count_enabled, const CBlockIndex *BlockReading) const |
| Get the time a masternode was last paid. More... | |
| int64_t | SecondsSincePayment (const MasternodeRef &mn, int count_enabled, const CBlockIndex *BlockReading) const |
| void | CacheBlockHash (const CBlockIndex *pindex) |
| void | UncacheBlockHash (const CBlockIndex *pindex) |
| uint256 | GetHashAtHeight (int nHeight) const |
| bool | IsWithinDepth (const uint256 &nHash, int depth) const |
| uint256 | GetBlockHashToPing () const |
| std::vector< uint256 > | GetCachedBlocks () const |
Public Attributes | |
| std::map< uint256, CMasternodeBroadcast > | mapSeenMasternodeBroadcast |
| std::map< uint256, CMasternodePing > | mapSeenMasternodePing |
| int64_t | nDsqCount |
Private Member Functions | |
| int | ProcessMNBroadcast (CNode *pfrom, CMasternodeBroadcast &mnb) |
| int | ProcessMNPing (CNode *pfrom, CMasternodePing &mnp) |
| int | ProcessMessageInner (CNode *pfrom, std::string &strCommand, CDataStream &vRecv) |
| void | BroadcastInvMN (CMasternode *mn, CNode *pfrom) |
| bool | CheckInputs (CMasternodeBroadcast &mnb, int nChainHeight, int &nDoS) |
Private Attributes | |
| RecursiveMutex | cs |
| RecursiveMutex | cs_process_message |
| std::map< COutPoint, MasternodeRef > | mapMasternodes |
| std::map< CNetAddr, int64_t > | mAskedUsForMasternodeList |
| std::map< CNetAddr, int64_t > | mWeAskedForMasternodeList |
| std::map< COutPoint, int64_t > | mWeAskedForMasternodeListEntry |
| std::atomic< int > | nBestHeight |
| CyclingVector< uint256 > | cvLastBlockHashes |
Definition at line 56 of file masternodeman.h.
| CMasternodeMan::CMasternodeMan | ( | ) |
Definition at line 183 of file masternodeman.cpp.
| bool CMasternodeMan::Add | ( | CMasternode & | mn | ) |
Add an entry.
Definition at line 188 of file masternodeman.cpp.
Ask (source) node for mnb.
Definition at line 217 of file masternodeman.cpp.
|
private |
Definition at line 888 of file masternodeman.cpp.
| void CMasternodeMan::CacheBlockHash | ( | const CBlockIndex * | pindex | ) |
| int CMasternodeMan::CheckAndRemove | ( | bool | forceExpiredRemoval = false | ) |
Check all Masternodes and remove inactive. Return the total masternode count.
Definition at line 238 of file masternodeman.cpp.
|
private |
Definition at line 745 of file masternodeman.cpp.
| void CMasternodeMan::CheckSpentCollaterals | ( | const std::vector< CTransactionRef > & | vtx | ) |
Check all transactions in a block, for spent masternode collateral outpoints (marking them as spent)
Definition at line 502 of file masternodeman.cpp.
| void CMasternodeMan::Clear | ( | ) |
Clear Masternode vector.
Definition at line 354 of file masternodeman.cpp.
| int CMasternodeMan::CountEnabled | ( | bool | only_legacy = false | ) | const |
Definition at line 429 of file masternodeman.cpp.
| CMasternode * CMasternodeMan::Find | ( | const COutPoint & | collateralOut | ) |
Find an entry.
Definition at line 476 of file masternodeman.cpp.
| const CMasternode * CMasternodeMan::Find | ( | const COutPoint & | collateralOut | ) | const |
Definition at line 483 of file masternodeman.cpp.
| CMasternode * CMasternodeMan::Find | ( | const CPubKey & | pubKeyMasternode | ) |
Definition at line 490 of file masternodeman.cpp.
|
inline |
|
inline |
Definition at line 194 of file masternodeman.h.
|
inline |
Definition at line 195 of file masternodeman.h.
| MasternodeRef CMasternodeMan::GetCurrentMasterNode | ( | const uint256 & | hash | ) | const |
Get the winner for this block hash.
Definition at line 612 of file masternodeman.cpp.
| uint256 CMasternodeMan::GetHashAtHeight | ( | int | nHeight | ) | const |
Definition at line 1114 of file masternodeman.cpp.
| int64_t CMasternodeMan::GetLastPaid | ( | const MasternodeRef & | mn, |
| int | count_enabled, | ||
| const CBlockIndex * | BlockReading | ||
| ) | const |
Get the time a masternode was last paid.
Definition at line 1061 of file masternodeman.cpp.
| int CMasternodeMan::GetMasternodeRank | ( | const CTxIn & | vin, |
| int64_t | nBlockHeight | ||
| ) | const |
Definition at line 665 of file masternodeman.cpp.
| std::vector< std::pair< int64_t, MasternodeRef > > CMasternodeMan::GetMasternodeRanks | ( | int | nBlockHeight | ) | const |
Definition at line 715 of file masternodeman.cpp.
| std::vector< std::pair< MasternodeRef, int > > CMasternodeMan::GetMnScores | ( | int | nLast | ) | const |
vector of pairs <masternode winner, height>
Definition at line 649 of file masternodeman.cpp.
| CMasternodeMan::MNsInfo CMasternodeMan::getMNsInfo | ( | ) | const |
Definition at line 388 of file masternodeman.cpp.
| MasternodeRef CMasternodeMan::GetNextMasternodeInQueueForPayment | ( | int | nBlockHeight, |
| bool | fFilterSigTime, | ||
| int & | nCount, | ||
| const CBlockIndex * | pChainTip = nullptr |
||
| ) | const |
Find an entry in the masternode list that is next to be paid.
Definition at line 541 of file masternodeman.cpp.
| bool CMasternodeMan::IsWithinDepth | ( | const uint256 & | nHash, |
| int | depth | ||
| ) | const |
Definition at line 1138 of file masternodeman.cpp.
| bool CMasternodeMan::ProcessMessage | ( | CNode * | pfrom, |
| std::string & | strCommand, | ||
| CDataStream & | vRecv, | ||
| int & | dosScore | ||
| ) |
|
private |
Definition at line 953 of file masternodeman.cpp.
|
private |
Definition at line 808 of file masternodeman.cpp.
|
private |
| void CMasternodeMan::Remove | ( | const COutPoint & | collateralOut | ) |
| bool CMasternodeMan::RequestMnList | ( | CNode * | pnode | ) |
Definition at line 450 of file masternodeman.cpp.
| int64_t CMasternodeMan::SecondsSincePayment | ( | const MasternodeRef & | mn, |
| int | count_enabled, | ||
| const CBlockIndex * | BlockReading | ||
| ) | const |
|
inline |
Definition at line 101 of file masternodeman.h.
|
inline |
| std::string CMasternodeMan::ToString | ( | ) | const |
Definition at line 1094 of file masternodeman.cpp.
| void CMasternodeMan::UncacheBlockHash | ( | const CBlockIndex * | pindex | ) |
| void CMasternodeMan::UpdateMasternodeList | ( | CMasternodeBroadcast & | mnb | ) |
Update masternode list and maps using provided CMasternodeBroadcast.
Definition at line 1024 of file masternodeman.cpp.
|
mutableprivate |
Definition at line 60 of file masternodeman.h.
|
mutableprivate |
Definition at line 63 of file masternodeman.h.
|
private |
Definition at line 78 of file masternodeman.h.
|
private |
Definition at line 66 of file masternodeman.h.
| std::map<uint256, CMasternodeBroadcast> CMasternodeMan::mapSeenMasternodeBroadcast |
Definition at line 93 of file masternodeman.h.
| std::map<uint256, CMasternodePing> CMasternodeMan::mapSeenMasternodePing |
Definition at line 95 of file masternodeman.h.
|
private |
Definition at line 68 of file masternodeman.h.
|
private |
Definition at line 70 of file masternodeman.h.
|
private |
Definition at line 72 of file masternodeman.h.
|
private |
Definition at line 75 of file masternodeman.h.
| int64_t CMasternodeMan::nDsqCount |
Definition at line 99 of file masternodeman.h.