1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2012 The Bitcoin developers
3 // Copyright (c) 2013 The NovaCoin developers
4 // Distributed under the MIT/X11 software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 #ifndef NOVACOIN_MINER_H
7 #define NOVACOIN_MINER_H
13 /* Generate a new block, without valid proof-of-work/with provided proof-of-stake */
14 std::shared_ptr<CBlock> CreateNewBlock(CWallet* pwallet, CTransaction *txAdd=NULL);
16 /** Modify the extranonce in a block */
17 void IncrementExtraNonce(std::shared_ptr<CBlock>& pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
19 /** Do mining precalculation */
20 void FormatHashBuffers(const std::shared_ptr<CBlock>& pblock, char* pmidstate, char* pdata, char* phash1);
22 /** Check mined proof-of-work block */
23 bool CheckWork(const std::shared_ptr<CBlock>& pblock, CWallet& wallet, CReserveKey& reservekey);
25 /** Check mined proof-of-stake block */
26 bool CheckStake(const std::shared_ptr<CBlock>& pblock, CWallet& wallet);
28 /** Base sha256 mining transform */
29 void SHA256Transform(void* pstate, void* pinput, const void* pinit);
31 /** Stake miner thread */
32 void ThreadStakeMiner(void* parg);
34 #endif // NOVACOIN_MINER_H