7 #ifndef BITCOIN_AUXPOW_H
8 #define BITCOIN_AUXPOW_H
24 static const unsigned char pchMergedMiningHeader[] = { 0xfa, 0xbe,
'm',
'm' };
52 SetTx(MakeTransactionRef());
58 SetTx(std::move(arg));
79 template <
typename Stream,
typename Operation>
153 template<
typename Stream,
typename Operation>
int64_t CAmount
Amount in satoshis (Can be negative)
Data for the merge-mining auxpow.
static uint256 CheckMerkleBranch(uint256 hash, const std::vector< uint256 > &vMerkleBranch, int nIndex)
Check a merkle branch.
CAuxPow(CTransactionRef txIn)
static void initAuxPow(CBlockHeader &header)
Initialise the auxpow of the given block header.
uint256 getParentBlockPoWHash() const
Get the parent block's hash.
bool check(const uint256 &hashAuxBlock, int nChainId, const Consensus::Params ¶ms) const
Check the auxpow, given the merge-mined block's hash and our chain ID.
CPureBlockHeader parentBlock
Parent block header (on which the real PoW is done).
int nChainIndex
Merkle tree index of the aux block header in the coinbase.
void SerializationOp(Stream &s, Operation ser_action)
const CPureBlockHeader & getParentBlock() const
Return parent block.
static int getExpectedIndex(uint32_t nNonce, int nChainId, unsigned h)
Calculate the expected index in the merkle tree.
std::vector< uint256 > vChainMerkleBranch
The merkle branch connecting the aux block to our coinbase.
The block chain is a tree shaped structure starting with the genesis block at the root,...
A transaction with a merkle branch linking it to the block chain.
CMerkleTx(CTransactionRef arg)
bool AcceptToMemoryPool(const CAmount &nAbsurdFee, CValidationState &state)
Pass this transaction to the mempool.
const uint256 & GetHash() const
int GetDepthInMainChain() const
void SetTx(CTransactionRef arg)
static const uint256 ABANDON_HASH
Constant used in hashBlock to indicate tx has been abandoned.
int GetBlocksToMaturity() const
void InitMerkleBranch(const CBlock &block, int posInBlock)
Actually compute the Merkle branch.
std::vector< uint256 > vMerkleBranch
void SetMerkleBranch(const CBlockIndex *pindex, int posInBlock)
void SerializationOp(Stream &s, Operation ser_action)
bool IsInMainChain() const
The basic transaction that is broadcasted on the network and contained in blocks.
Capture information about block/transaction validation.
Parameters that influence chain consensus.
std::shared_ptr< const CTransaction > CTransactionRef