BN_zero -> BN_set_word
[novacoin.git] / src / miner.h
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
8
9 #include "main.h"
10 #include "wallet.h"
11 #include <memory>
12
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);
15
16 /** Modify the extranonce in a block */
17 void IncrementExtraNonce(std::shared_ptr<CBlock>& pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
18
19 /** Do mining precalculation */
20 void FormatHashBuffers(const std::shared_ptr<CBlock>& pblock, char* pmidstate, char* pdata, char* phash1);
21
22 /** Check mined proof-of-work block */
23 bool CheckWork(const std::shared_ptr<CBlock>& pblock, CWallet& wallet, CReserveKey& reservekey);
24
25 /** Check mined proof-of-stake block */
26 bool CheckStake(const std::shared_ptr<CBlock>& pblock, CWallet& wallet);
27
28 /** Base sha256 mining transform */
29 void SHA256Transform(void* pstate, void* pinput, const void* pinit);
30
31 /** Stake miner thread */
32 void ThreadStakeMiner(void* parg);
33
34 #endif // NOVACOIN_MINER_H