 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
7 #ifndef MASTERNODE_PAYMENTS_H
8 #define MASTERNODE_PAYMENTS_H
25 #define MNPAYMENTS_SIGNATURES_REQUIRED 6
26 #define MNPAYMENTS_SIGNATURES_TOTAL 10
79 template <
typename Stream,
typename Operation>
80 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion)
105 void AddPayee(
int nIncrement, std::vector<unsigned char> masternodeStealthAddress)
110 if (payee.masternodeStealthAddress == masternodeStealthAddress) {
111 payee.nVotes += nIncrement;
126 if (p.nVotes > nVotes) {
127 payee = p.masternodeStealthAddress;
132 return (nVotes > -1);
140 if (p.nVotes >= nVotesReq && p.masternodeStealthAddress == payee)
return true;
151 template <
typename Stream,
typename Operation>
205 template <
typename Stream,
typename Operation>
217 std::string ret =
"";
221 ret +=
", " + std::to_string((
int)
vchSig.size());
258 void Sync(
CNode* node,
int nCountNeeded);
262 bool GetBlockPayee(
int nBlockHeight, std::vector<unsigned char>& payee);
291 template <
typename Stream,
typename Operation>
An input of a transaction.
bool IsBlockValueValid(int nHeight, CAmount nExpectedValue, CAmount nMinted)
int GetMinMasternodePaymentsProto()
bool CanVote(COutPoint outMasternode, int nBlockHeight)
bool Write(const CMasternodePayments &objToSave)
ReadResult Read(CMasternodePayments &objToLoad, bool fDryRun=false)
void Sync(CNode *node, int nCountNeeded)
bool GetBlockPayee(int nBlockHeight, std::vector< unsigned char > &payee)
bool HasPayeeWithVotes(std::vector< unsigned char > payee, int nVotesReq)
RecursiveMutex cs_mapMasternodePayeeVotes
std::string strMagicMessage
bool IsValid(CNode *pnode, std::string &strError)
Information about a peer.
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
RecursiveMutex cs_vecPayments
CMasternodePayee(int nVotesIn, std::vector< unsigned char > masternodeStealthAddress)
bool ProcessBlock(int nBlockHeight)
std::map< uint256, CMasternodePaymentWinner > mapMasternodePayeeVotes
void AddPayee(std::vector< unsigned char > payeeIn)
void AddPayee(int nIncrement, std::vector< unsigned char > masternodeStealthAddress)
std::vector< CMasternodePayee > vecPayments
Save Masternode Payment Data (mnpayments.dat)
bool Sign(CKey &keyMasternode, CPubKey &pubKeyMasternode)
std::vector< unsigned char > masternodeStealthAddress
The basic transaction that is broadcasted on the network and contained in blocks.
std::string GetRequiredPaymentsString(int nBlockHeight)
CMasternodePaymentWinner()
bool IsTransactionValid(const CTransaction &txNew)
int LastPayment(CMasternode &mn)
std::vector< unsigned char > payee
bool FillBlockPayee(CMutableTransaction &txNew, int64_t nFees, bool fProofOfStake)
std::string GetRequiredPaymentsString()
std::string GetRequiredPaymentsString(int nBlockHeight)
void DumpMasternodePayments()
int64_t CAmount
Amount in PRCY (Can be negative)
CMasternodePayments masternodePayments
Object for who's going to get paid on which blocks.
256-bit unsigned big integer.
std::map< uint256, int > mapMasternodesLastVote
CMasternodeBlockPayees(int nBlockHeightIn)
std::map< int, CMasternodeBlockPayees > mapMasternodeBlocks
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool GetPayee(std::vector< unsigned char > &payee)
An encapsulated public key.
An encapsulated private key.
std::string ToString() const
A writer stream (for serialization) that computes a 256-bit hash.
bool FillBlockPayee(CMutableTransaction &txNew, CAmount nFees, bool fProofOfStake)
bool IsTransactionValid(const CTransaction &txNew, int nBlockHeight)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
Double ended buffer combining vector and stream-like interfaces.
An outpoint - a combination of a transaction hash and an index n into its vout.
RecursiveMutex cs_mapMasternodeBlocks
A mutable version of CTransaction.
bool IsBlockPayeeValid(const CBlock &block, int nBlockHeight)
void ProcessMessageMasternodePayments(CNode *pfrom, std::string &strCommand, CDataStream &vRecv)
CMasternodePaymentWinner(CTxIn vinIn)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool IsScheduled(CMasternode &mn, int nNotBlockHeight)
std::vector< unsigned char > masternodeStealthAddress
std::vector< unsigned char > vchSig
bool AddWinningMasternode(CMasternodePaymentWinner &winner)
std::string ToString() const
void ProcessMessageMasternodePayments(CNode *pfrom, std::string &strCommand, CDataStream &vRecv)