PIVX Core  5.6.99
P2P Digital Currency
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
CMasternodePayments Class Reference

#include <masternode-payments.h>

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

Public Member Functions

 CMasternodePayments ()
 
void Clear ()
 
void UpdatedBlockTip (const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
 Notifies listeners when the block chain tip advances. More...
 
void AddWinningMasternode (CMasternodePaymentWinner &winner)
 
void ProcessBlock (int nBlockHeight)
 
void Sync (CNode *node, int nCountNeeded)
 
void CleanPaymentList (int mnCount, int nHeight)
 
bool GetMasternodeTxOuts (const CBlockIndex *pindexPrev, std::vector< CTxOut > &voutMasternodePaymentsRet) const
 
bool GetLegacyMasternodeTxOut (int nHeight, std::vector< CTxOut > &voutMasternodePaymentsRet) const
 
bool GetBlockPayee (int nBlockHeight, CScript &payee) const
 
bool IsTransactionValid (const CTransaction &txNew, const CBlockIndex *pindexPrev)
 
bool IsScheduled (const CMasternode &mn, int nNotBlockHeight)
 
bool ProcessMNWinner (CMasternodePaymentWinner &winner, CNode *pfrom, CValidationState &state)
 
bool ProcessMessageMasternodePayments (CNode *pfrom, std::string &strCommand, CDataStream &vRecv, CValidationState &state)
 
std::string GetRequiredPaymentsString (int nBlockHeight)
 
void FillBlockPayee (CMutableTransaction &txCoinbase, CMutableTransaction &txCoinstake, const CBlockIndex *pindexPrev, bool fProofOfStake) const
 
std::string ToString () const
 
 SERIALIZE_METHODS (CMasternodePayments, obj)
 
- Public Member Functions inherited from CValidationInterface
virtual ~CValidationInterface ()=default
 
virtual void AcceptedBlockHeader (const CBlockIndex *pindexNew)
 

Public Attributes

std::map< uint256, CMasternodePaymentWinnermapMasternodePayeeVotes
 
std::map< int, CMasternodeBlockPayeesmapMasternodeBlocks
 

Private Member Functions

bool CanVote (const COutPoint &outMasternode, int nBlockHeight) const
 
void RecordWinnerVote (const COutPoint &outMasternode, int nBlockHeight)
 

Private Attributes

int nLastBlockHeight
 
std::map< COutPoint, int > mapMasternodesLastVote
 

Additional Inherited Members

- Protected Member Functions inherited from CValidationInterface
virtual void TransactionAddedToMempool (const CTransactionRef &ptxn)
 Notifies listeners of a transaction having been added to mempool. More...
 
virtual void TransactionRemovedFromMempool (const CTransactionRef &ptx, MemPoolRemovalReason reason)
 Notifies listeners of a transaction leaving mempool. More...
 
virtual void BlockConnected (const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex)
 Notifies listeners of a block being connected. More...
 
virtual void BlockDisconnected (const std::shared_ptr< const CBlock > &block, const uint256 &blockHash, int nBlockHeight, int64_t blockTime)
 Notifies listeners of a block being disconnected. More...
 
virtual void SetBestChain (const CBlockLocator &locator)
 Notifies listeners of the new active block chain on-disk. More...
 
virtual void ResendWalletTransactions (CConnman *connman)
 Tells listeners to broadcast their data. More...
 
virtual void BlockChecked (const CBlock &, const CValidationState &)
 
friend void ::RegisterSharedValidationInterface (std::shared_ptr< CValidationInterface >)
 
friend void ::UnregisterValidationInterface (CValidationInterface *)
 
friend void ::UnregisterAllValidationInterfaces ()
 
virtual void NotifyMasternodeListChanged (bool undo, const CDeterministicMNList &oldMNList, const CDeterministicMNListDiff &diff)
 Notifies listeners of updated deterministic masternode list. More...
 

Detailed Description

Definition at line 206 of file masternode-payments.h.

Constructor & Destructor Documentation

◆ CMasternodePayments()

CMasternodePayments::CMasternodePayments ( )
inline

Definition at line 215 of file masternode-payments.h.

Member Function Documentation

◆ AddWinningMasternode()

void CMasternodePayments::AddWinningMasternode ( CMasternodePaymentWinner winner)

Definition at line 552 of file masternode-payments.cpp.

Here is the call graph for this function:

◆ CanVote()

bool CMasternodePayments::CanVote ( const COutPoint outMasternode,
int  nBlockHeight 
) const
private

Definition at line 811 of file masternode-payments.cpp.

Here is the caller graph for this function:

◆ CleanPaymentList()

void CMasternodePayments::CleanPaymentList ( int  mnCount,
int  nHeight 
)

Definition at line 679 of file masternode-payments.cpp.

Here is the call graph for this function:

◆ Clear()

void CMasternodePayments::Clear ( )
inline

Definition at line 220 of file masternode-payments.h.

◆ FillBlockPayee()

void CMasternodePayments::FillBlockPayee ( CMutableTransaction txCoinbase,
CMutableTransaction txCoinstake,
const CBlockIndex pindexPrev,
bool  fProofOfStake 
) const

Definition at line 361 of file masternode-payments.cpp.

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

◆ GetBlockPayee()

bool CMasternodePayments::GetBlockPayee ( int  nBlockHeight,
CScript payee 
) const

Definition at line 518 of file masternode-payments.cpp.

Here is the caller graph for this function:

◆ GetLegacyMasternodeTxOut()

bool CMasternodePayments::GetLegacyMasternodeTxOut ( int  nHeight,
std::vector< CTxOut > &  voutMasternodePaymentsRet 
) const

Definition at line 321 of file masternode-payments.cpp.

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

◆ GetMasternodeTxOuts()

bool CMasternodePayments::GetMasternodeTxOuts ( const CBlockIndex pindexPrev,
std::vector< CTxOut > &  voutMasternodePaymentsRet 
) const
Todo:
: remove when transition to DMN is complete

Definition at line 295 of file masternode-payments.cpp.

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

◆ GetRequiredPaymentsString()

std::string CMasternodePayments::GetRequiredPaymentsString ( int  nBlockHeight)

Definition at line 634 of file masternode-payments.cpp.

Here is the caller graph for this function:

◆ IsScheduled()

bool CMasternodePayments::IsScheduled ( const CMasternode mn,
int  nNotBlockHeight 
)

Definition at line 530 of file masternode-payments.cpp.

Here is the call graph for this function:

◆ IsTransactionValid()

bool CMasternodePayments::IsTransactionValid ( const CTransaction txNew,
const CBlockIndex pindexPrev 
)
Todo:
: remove when transition to DMN is complete

Definition at line 645 of file masternode-payments.cpp.

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

◆ ProcessBlock()

void CMasternodePayments::ProcessBlock ( int  nBlockHeight)

Definition at line 708 of file masternode-payments.cpp.

Here is the caller graph for this function:

◆ ProcessMessageMasternodePayments()

bool CMasternodePayments::ProcessMessageMasternodePayments ( CNode pfrom,
std::string &  strCommand,
CDataStream vRecv,
CValidationState state 
)
Todo:
: remove when transition to DMN is complete

Definition at line 399 of file masternode-payments.cpp.

Here is the call graph for this function:

◆ ProcessMNWinner()

bool CMasternodePayments::ProcessMNWinner ( CMasternodePaymentWinner winner,
CNode pfrom,
CValidationState state 
)

Definition at line 443 of file masternode-payments.cpp.

Here is the call graph for this function:

◆ RecordWinnerVote()

void CMasternodePayments::RecordWinnerVote ( const COutPoint outMasternode,
int  nBlockHeight 
)
private

Definition at line 818 of file masternode-payments.cpp.

◆ SERIALIZE_METHODS()

CMasternodePayments::SERIALIZE_METHODS ( CMasternodePayments  ,
obj   
)
inline

Definition at line 251 of file masternode-payments.h.

◆ Sync()

void CMasternodePayments::Sync ( CNode node,
int  nCountNeeded 
)

Definition at line 781 of file masternode-payments.cpp.

Here is the call graph for this function:

◆ ToString()

std::string CMasternodePayments::ToString ( ) const

Definition at line 802 of file masternode-payments.cpp.

◆ UpdatedBlockTip()

void CMasternodePayments::UpdatedBlockTip ( const CBlockIndex pindexNew,
const CBlockIndex pindexFork,
bool  fInitialDownload 
)
overridevirtual

Notifies listeners when the block chain tip advances.

When multiple blocks are connected at once, UpdatedBlockTip will be called on the final tip but may not be called on every intermediate tip. If the latter behavior is desired, subscribe to BlockConnected() instead.

Called on a background thread.

Reimplemented from CValidationInterface.

Definition at line 701 of file masternode-payments.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ mapMasternodeBlocks

std::map<int, CMasternodeBlockPayees> CMasternodePayments::mapMasternodeBlocks

Definition at line 213 of file masternode-payments.h.

◆ mapMasternodePayeeVotes

std::map<uint256, CMasternodePaymentWinner> CMasternodePayments::mapMasternodePayeeVotes

Definition at line 212 of file masternode-payments.h.

◆ mapMasternodesLastVote

std::map<COutPoint, int> CMasternodePayments::mapMasternodesLastVote
private

Definition at line 255 of file masternode-payments.h.

◆ nLastBlockHeight

int CMasternodePayments::nLastBlockHeight
private

Definition at line 209 of file masternode-payments.h.


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