]>
Commit | Line | Data |
---|---|---|
d247a5d1 | 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto |
f914f1a7 | 2 | // Copyright (c) 2009-2013 The Bitcoin Core developers |
78253fcb | 3 | // Distributed under the MIT software license, see the accompanying |
d247a5d1 | 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. |
51ed9ec9 | 5 | |
d247a5d1 JG |
6 | #ifndef BITCOIN_MINER_H |
7 | #define BITCOIN_MINER_H | |
8 | ||
2ce63d39 LD |
9 | #include "primitives/block.h" |
10 | ||
8e8b6d70 | 11 | #include <boost/optional.hpp> |
51ed9ec9 BD |
12 | #include <stdint.h> |
13 | ||
51ed9ec9 | 14 | class CBlockIndex; |
51ed9ec9 | 15 | class CScript; |
8e8b6d70 JG |
16 | #ifdef ENABLE_WALLET |
17 | class CReserveKey; | |
51ed9ec9 | 18 | class CWallet; |
8e8b6d70 | 19 | #endif |
30c43d98 | 20 | namespace Consensus { struct Params; }; |
d247a5d1 | 21 | |
2ce63d39 LD |
22 | struct CBlockTemplate |
23 | { | |
24 | CBlock block; | |
25 | std::vector<CAmount> vTxFees; | |
26 | std::vector<int64_t> vTxSigOps; | |
27 | }; | |
16593898 | 28 | #define KOMODO_MAXGPUCOUNT 65 |
ac14bcc1 | 29 | |
d247a5d1 | 30 | /** Generate a new block, without valid proof-of-work */ |
16593898 | 31 | CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount); |
8e8b6d70 JG |
32 | #ifdef ENABLE_WALLET |
33 | boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey); | |
16593898 | 34 | CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey,int32_t nHeight,int32_t gpucount); |
8e8b6d70 JG |
35 | #else |
36 | boost::optional<CScript> GetMinerScriptPubKey(); | |
37 | CBlockTemplate* CreateNewBlockWithKey(); | |
38 | #endif | |
c1de826f JG |
39 | |
40 | #ifdef ENABLE_MINING | |
d247a5d1 JG |
41 | /** Modify the extranonce in a block */ |
42 | void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce); | |
c1de826f JG |
43 | /** Run the miner threads */ |
44 | #ifdef ENABLE_WALLET | |
45 | void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads); | |
46 | #else | |
47 | void GenerateBitcoins(bool fGenerate, int nThreads); | |
48 | #endif | |
49 | #endif | |
50 | ||
bebe7282 | 51 | void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev); |
d247a5d1 JG |
52 | |
53 | #endif // BITCOIN_MINER_H |