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.
6 #ifndef BITCOIN_MINER_H
7 #define BITCOIN_MINER_H
9 #include "primitives/block.h"
11 #include <boost/optional.hpp>
20 namespace Consensus { struct Params; };
25 std::vector<CAmount> vTxFees;
26 std::vector<int64_t> vTxSigOps;
29 /** Generate a new block, without valid proof-of-work */
30 CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
32 boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey);
33 CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey);
35 boost::optional<CScript> GetMinerScriptPubKey();
36 CBlockTemplate* CreateNewBlockWithKey();
40 /** Modify the extranonce in a block */
41 void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
42 /** Run the miner threads */
44 void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
46 void GenerateBitcoins(bool fGenerate, int nThreads);
50 void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
52 #endif // BITCOIN_MINER_H