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 https://www.opensource.org/licenses/mit-license.php .
6 #ifndef BITCOIN_MINER_H
7 #define BITCOIN_MINER_H
9 #include "primitives/block.h"
11 #include "wallet/wallet.h"
14 #include <boost/optional.hpp>
20 namespace Consensus { struct Params; };
25 std::vector<CAmount> vTxFees;
26 std::vector<int64_t> vTxSigOps;
28 #define KOMODO_MAXGPUCOUNT 65
30 /** Generate a new block, without valid proof-of-work */
31 CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& scriptPubKeyIn, int32_t gpucount=0, bool isStake=false);
33 boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey);
34 CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey, int32_t nHeight, int32_t gpucount, bool isStake = false);
36 boost::optional<CScript> GetMinerScriptPubKey();
37 CBlockTemplate* CreateNewBlockWithKey();
41 /** Get script for -mineraddress */
42 void GetScriptForMinerAddress(boost::shared_ptr<CReserveScript> &script);
43 /** Modify the extranonce in a block */
44 void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce, bool buildMerkle=true, uint32_t *pSaveBits=NULL);
45 /** Run the miner threads */
47 void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
49 void GenerateBitcoins(bool fGenerate, int nThreads);
53 void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
55 #endif // BITCOIN_MINER_H