]> Git Repo - VerusCoin.git/blob - src/miner.h
Add method for fetching the next activation height after a given block height
[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 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 <boost/optional.hpp>
12 #include <stdint.h>
13
14 class CBlockIndex;
15 class CScript;
16 #ifdef ENABLE_WALLET
17 class CReserveKey;
18 class CWallet;
19 #endif
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
29 /** Generate a new block, without valid proof-of-work */
30 CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
31 #ifdef ENABLE_WALLET
32 boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey);
33 CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey);
34 #else
35 boost::optional<CScript> GetMinerScriptPubKey();
36 CBlockTemplate* CreateNewBlockWithKey();
37 #endif
38
39 #ifdef ENABLE_MINING
40 /** Modify the extranonce in a block */
41 void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
42 /** Run the miner threads */
43  #ifdef ENABLE_WALLET
44 void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
45  #else
46 void GenerateBitcoins(bool fGenerate, int nThreads);
47  #endif
48 #endif
49
50 void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
51
52 #endif // BITCOIN_MINER_H
This page took 0.026977 seconds and 4 git commands to generate.