2013-07-31 09:43:35 -04:00
|
|
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
2014-12-16 22:47:57 -03:00
|
|
|
// Copyright (c) 2009-2013 The Bitcoin Core developers
|
2014-12-13 01:09:33 -03:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-07-31 09:43:35 -04:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
2013-04-13 02:13:08 -03:00
|
|
|
|
2013-07-31 09:43:35 -04:00
|
|
|
#ifndef BITCOIN_MINER_H
|
|
|
|
#define BITCOIN_MINER_H
|
|
|
|
|
2014-10-12 00:26:42 -03:00
|
|
|
#include "primitives/block.h"
|
|
|
|
|
2013-04-13 02:13:08 -03:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
class CBlockIndex;
|
2015-04-10 07:49:01 -03:00
|
|
|
class CChainParams;
|
2013-04-13 02:13:08 -03:00
|
|
|
class CReserveKey;
|
|
|
|
class CScript;
|
|
|
|
class CWallet;
|
2015-04-16 05:32:47 -03:00
|
|
|
namespace Consensus { struct Params; };
|
2013-07-31 09:43:35 -04:00
|
|
|
|
2015-06-27 20:48:38 -03:00
|
|
|
static const int DEFAULT_GENERATE_THREADS = 1;
|
|
|
|
|
2014-10-12 00:26:42 -03:00
|
|
|
struct CBlockTemplate
|
|
|
|
{
|
|
|
|
CBlock block;
|
|
|
|
std::vector<CAmount> vTxFees;
|
|
|
|
std::vector<int64_t> vTxSigOps;
|
|
|
|
};
|
2014-05-10 08:54:20 -04:00
|
|
|
|
2013-07-31 09:43:35 -04:00
|
|
|
/** Run the miner threads */
|
2015-04-10 07:49:01 -03:00
|
|
|
void GenerateBitcoins(bool fGenerate, int nThreads, const CChainParams& chainparams);
|
2013-07-31 09:43:35 -04:00
|
|
|
/** Generate a new block, without valid proof-of-work */
|
2015-04-10 02:33:06 -03:00
|
|
|
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
|
2013-07-31 09:43:35 -04:00
|
|
|
/** Modify the extranonce in a block */
|
2015-08-08 13:18:41 -03:00
|
|
|
void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
|
2015-05-22 18:49:50 -03:00
|
|
|
int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
|
2013-07-31 09:43:35 -04:00
|
|
|
|
|
|
|
#endif // BITCOIN_MINER_H
|