1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2013 The Bitcoin developers
3 // Distributed under the MIT/X11 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
17 struct CBlockTemplate;
19 /** Run the miner threads */
20 void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
21 /** Generate a new block, without valid proof-of-work */
22 CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
23 CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey);
24 /** Modify the extranonce in a block */
25 void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
26 /** Check mined block */
27 bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey);
29 extern double dHashesPerSec;
30 extern int64_t nHPSTimerStart;
32 #endif // BITCOIN_MINER_H