2019-01-29 15:53:14 +01:00
|
|
|
// Copyright (c) 2014-2019 The Dash Core developers
|
2015-04-16 21:58:09 +02:00
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
2016-09-15 08:50:01 +02:00
|
|
|
|
2015-04-16 21:58:09 +02:00
|
|
|
#ifndef MASTERNODE_PAYMENTS_H
|
|
|
|
#define MASTERNODE_PAYMENTS_H
|
|
|
|
|
2016-08-17 09:08:25 +02:00
|
|
|
#include "util.h"
|
2016-02-02 16:28:56 +01:00
|
|
|
#include "core_io.h"
|
2015-04-16 21:58:09 +02:00
|
|
|
#include "key.h"
|
2017-08-09 02:19:06 +02:00
|
|
|
#include "net_processing.h"
|
2016-02-02 16:28:56 +01:00
|
|
|
#include "utilstrencodings.h"
|
|
|
|
|
2019-01-03 21:08:34 +01:00
|
|
|
#include "evo/deterministicmns.h"
|
|
|
|
|
2016-09-15 08:50:01 +02:00
|
|
|
class CMasternodePayments;
|
2015-04-22 16:33:44 +02:00
|
|
|
|
2016-08-22 03:41:40 +02:00
|
|
|
/// TODO: all 4 functions do not belong here really, they should be refactored/moved somewhere (main.cpp ?)
|
2018-02-21 17:32:08 +01:00
|
|
|
bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockReward, std::string& strErrorRet);
|
2016-08-22 03:41:40 +02:00
|
|
|
bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount blockReward);
|
2018-08-14 11:58:38 +02:00
|
|
|
void FillBlockPayments(CMutableTransaction& txNew, int nBlockHeight, CAmount blockReward, std::vector<CTxOut>& voutMasternodePaymentsRet, std::vector<CTxOut>& voutSuperblockPaymentsRet);
|
2018-04-04 17:20:54 +02:00
|
|
|
std::map<int, std::string> GetRequiredPaymentsStrings(int nStartHeight, int nEndHeight);
|
2015-04-22 16:33:44 +02:00
|
|
|
|
2019-01-03 10:17:43 +01:00
|
|
|
extern CMasternodePayments mnpayments;
|
2015-04-16 21:58:09 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// Masternode Payments Class
|
|
|
|
// Keeps track of who should get paid for which blocks
|
|
|
|
//
|
|
|
|
|
|
|
|
class CMasternodePayments
|
|
|
|
{
|
|
|
|
public:
|
2018-08-14 11:58:38 +02:00
|
|
|
bool GetBlockTxOuts(int nBlockHeight, CAmount blockReward, std::vector<CTxOut>& voutMasternodePaymentsRet) const;
|
2018-08-12 17:27:09 +02:00
|
|
|
bool IsTransactionValid(const CTransaction& txNew, int nBlockHeight, CAmount blockReward) const;
|
2018-12-17 15:45:36 +01:00
|
|
|
bool IsScheduled(const CDeterministicMNCPtr& dmn, int nNotBlockHeight) const;
|
2015-04-22 16:33:44 +02:00
|
|
|
|
2018-08-14 11:58:38 +02:00
|
|
|
bool GetMasternodeTxOuts(int nBlockHeight, CAmount blockReward, std::vector<CTxOut>& voutMasternodePaymentsRet) const;
|
2015-04-16 21:58:09 +02:00
|
|
|
};
|
|
|
|
|
2015-07-08 03:57:32 +02:00
|
|
|
#endif
|