2018-04-06 11:00:10 +02:00
|
|
|
// Copyright (c) 2017 The Dash Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef DASH_CBTX_H
|
|
|
|
#define DASH_CBTX_H
|
|
|
|
|
|
|
|
#include "primitives/transaction.h"
|
|
|
|
#include "consensus/validation.h"
|
|
|
|
|
2018-04-09 10:35:43 +02:00
|
|
|
class CBlock;
|
2018-04-06 11:00:10 +02:00
|
|
|
class CBlockIndex;
|
|
|
|
class UniValue;
|
|
|
|
|
|
|
|
// coinbase transaction
|
|
|
|
class CCbTx
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static const uint16_t CURRENT_VERSION = 1;
|
|
|
|
|
|
|
|
public:
|
|
|
|
uint16_t nVersion{CURRENT_VERSION};
|
|
|
|
int32_t nHeight{0};
|
|
|
|
uint256 merkleRootMNList;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ADD_SERIALIZE_METHODS;
|
|
|
|
|
|
|
|
template <typename Stream, typename Operation>
|
|
|
|
inline void SerializationOp(Stream& s, Operation ser_action)
|
|
|
|
{
|
|
|
|
READWRITE(nVersion);
|
|
|
|
READWRITE(nHeight);
|
|
|
|
READWRITE(merkleRootMNList);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string ToString() const;
|
|
|
|
void ToJson(UniValue& obj) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool CheckCbTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state);
|
|
|
|
|
2018-04-09 10:35:43 +02:00
|
|
|
bool CheckCbTxMerkleRootMNList(const CBlock& block, const CBlockIndex* pindex, CValidationState& state);
|
|
|
|
bool CalcCbTxMerkleRootMNList(const CBlock& block, const CBlockIndex* pindexPrev, uint256& merkleRootRet, CValidationState& state);
|
|
|
|
|
2018-04-06 11:00:10 +02:00
|
|
|
#endif//DASH_CBTX_H
|