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
17 /* Generate a new block, without valid proof-of-work/with provided proof-of-stake */
18 std::shared_ptr<CBlock> CreateNewBlock(CWallet* pwallet, CTransaction *txAdd=nullptr);
20 /** Modify the extranonce in a block */
21 void IncrementExtraNonce(std::shared_ptr<CBlock>& pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
23 /** Do mining precalculation */
24 void FormatHashBuffers(const std::shared_ptr<CBlock>& pblock, char* pmidstate, char* pdata, char* phash1);
26 /** Check mined proof-of-work block */
27 bool CheckWork(const std::shared_ptr<CBlock>& pblock, CWallet& wallet, CReserveKey& reservekey);
29 /** Check mined proof-of-stake block */
30 bool CheckStake(const std::shared_ptr<CBlock>& pblock, CWallet& wallet);
32 /** Base sha256 mining transform */
33 void SHA256Transform(void* pstate, void* pinput, const void* pinit);
35 /** Stake miner thread */
36 void ThreadStakeMiner(void* parg);
38 #endif // NOVACOIN_MINER_H