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
18 struct CBlockTemplate;
20 /** Run the miner threads */
21 void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
22 /** Generate a new block, without valid proof-of-work */
23 CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
24 CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey);
25 /** Modify the extranonce in a block */
26 void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
27 /** Check mined block */
28 bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey);
29 void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev);
31 extern double dHashesPerSec;
32 extern int64_t nHPSTimerStart;
34 #endif // BITCOIN_MINER_H