]> Git Repo - VerusCoin.git/blob - src/miner.h
Incorporate all Zcash updates through 2.0.7-3 in addition to PBaaS, reserves, etc.
[VerusCoin.git] / src / miner.h
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 .
5
6 #ifndef BITCOIN_MINER_H
7 #define BITCOIN_MINER_H
8
9 #include "primitives/block.h"
10 #ifdef ENABLE_WALLET
11 #include "wallet/wallet.h"
12 #endif
13
14 #include <boost/optional.hpp>
15 #include <stdint.h>
16
17 class CBlockIndex;
18 class CChainParams;
19 class CScript;
20 namespace Consensus { struct Params; };
21
22 struct CBlockTemplate
23 {
24     CBlock block;
25     std::vector<CAmount> vTxFees;
26     std::vector<int64_t> vTxSigOps;
27 };
28 #define KOMODO_MAXGPUCOUNT 65
29
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);
32 #ifdef ENABLE_WALLET
33 boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey);
34 CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey, int32_t nHeight, int32_t gpucount, bool isStake = false);
35 #else
36 boost::optional<CScript> GetMinerScriptPubKey();
37 CBlockTemplate* CreateNewBlockWithKey();
38 #endif
39
40 #ifdef ENABLE_MINING
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 */
46 #ifdef ENABLE_WALLET
47     void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
48 #else
49     void GenerateBitcoins(bool fGenerate, int nThreads);
50 #endif
51 #endif
52
53 void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
54
55 #endif // BITCOIN_MINER_H
This page took 0.026853 seconds and 4 git commands to generate.