Dash Core  0.12.2.1
P2P Digital Currency
masternode-payments.h File Reference
#include "util.h"
#include "core_io.h"
#include "key.h"
#include "masternode.h"
#include "net_processing.h"
#include "utilstrencodings.h"

Go to the source code of this file.

Classes

class  CMasternodePayee
 
class  CMasternodeBlockPayees
 
class  CMasternodePaymentVote
 
class  CMasternodePayments
 

Functions

bool IsBlockValueValid (const CBlock &block, int nBlockHeight, CAmount blockReward, std::string &strErrorRet)
 TODO: all 4 functions do not belong here really, they should be refactored/moved somewhere (main.cpp ?) More...
 
bool IsBlockPayeeValid (const CTransaction &txNew, int nBlockHeight, CAmount blockReward)
 
void FillBlockPayments (CMutableTransaction &txNew, int nBlockHeight, CAmount blockReward, CTxOut &txoutMasternodeRet, std::vector< CTxOut > &voutSuperblockRet)
 
std::string GetRequiredPaymentsString (int nBlockHeight)
 

Variables

static const int MNPAYMENTS_SIGNATURES_REQUIRED = 6
 
static const int MNPAYMENTS_SIGNATURES_TOTAL = 10
 
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70206
 minimum peer version that can receive and send masternode payment messages, More...
 
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70208
 
CCriticalSection cs_vecPayees
 
CCriticalSection cs_mapMasternodeBlocks
 
CCriticalSection cs_mapMasternodePayeeVotes
 
CMasternodePayments mnpayments
 

Function Documentation

◆ FillBlockPayments()

void FillBlockPayments ( CMutableTransaction txNew,
int  nBlockHeight,
CAmount  blockReward,
CTxOut txoutMasternodeRet,
std::vector< CTxOut > &  voutSuperblockRet 
)

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

Referenced by CreateNewBlock().

◆ GetRequiredPaymentsString()

std::string GetRequiredPaymentsString ( int  nBlockHeight)

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

Referenced by masternode().

◆ IsBlockPayeeValid()

bool IsBlockPayeeValid ( const CTransaction txNew,
int  nBlockHeight,
CAmount  blockReward 
)

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

Referenced by ConnectBlock().

◆ IsBlockValueValid()

bool IsBlockValueValid ( const CBlock block,
int  nBlockHeight,
CAmount  blockReward,
std::string &  strErrorRet 
)

TODO: all 4 functions do not belong here really, they should be refactored/moved somewhere (main.cpp ?)

IsBlockValueValid

Determine if coinbase outgoing created money is the correct value

Why is this needed?

  • In Dash some blocks are superblocks, which output much higher amounts of coins
  • Otherblocks are 10% lower in outgoing value, so in total, no extra coins are created
  • When non-superblocks are detected, the normal schedule should be maintained

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

Referenced by ConnectBlock().

Variable Documentation

◆ cs_mapMasternodeBlocks

◆ cs_mapMasternodePayeeVotes

CCriticalSection cs_mapMasternodePayeeVotes

◆ cs_vecPayees

◆ MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1

const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70206
static

minimum peer version that can receive and send masternode payment messages,

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

Referenced by CMasternodePayments::GetMinMasternodePaymentsProto(), and CMasternodePaymentVote::IsValid().

◆ MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2

const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70208
static

◆ mnpayments

◆ MNPAYMENTS_SIGNATURES_REQUIRED

const int MNPAYMENTS_SIGNATURES_REQUIRED = 6
static

◆ MNPAYMENTS_SIGNATURES_TOTAL