Line data Source code
1 : // Copyright (c) 2009-2010 Satoshi Nakamoto
2 : // Copyright (c) 2009-2013 The Bitcoin Core developers
3 : // Distributed under the MIT software license, see the accompanying
4 : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 :
6 : #ifndef BITCOIN_MINER_H
7 : #define BITCOIN_MINER_H
8 :
9 : #include "primitives/block.h"
10 :
11 : #include <stdint.h>
12 :
13 : class CBlockIndex;
14 : class CChainParams;
15 : class CReserveKey;
16 : class CScript;
17 : class CWallet;
18 : namespace Consensus { struct Params; };
19 :
20 8118 : struct CBlockTemplate
21 : {
22 : CBlock block;
23 : std::vector<CAmount> vTxFees;
24 : std::vector<int64_t> vTxSigOps;
25 : };
26 :
27 : /** Run the miner threads */
28 : void GenerateBitcoins(bool fGenerate, int nThreads, const CChainParams& chainparams);
29 : /** Generate a new block, without valid proof-of-work */
30 : CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
31 : /** Modify the extranonce in a block */
32 : void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
33 : int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
34 :
35 : #endif // BITCOIN_MINER_H
|