Update CMakeLists.txt - play with openssl
[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 <memory>
10
11 class CBlock;
12 class CBlockIndex;
13 class CTransaction;
14 class CReserveKey;
15 class CWallet;
16
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);
19
20 /** Modify the extranonce in a block */
21 void IncrementExtraNonce(std::shared_ptr<CBlock>& pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
22
23 /** Do mining precalculation */
24 void FormatHashBuffers(const std::shared_ptr<CBlock>& pblock, char* pmidstate, char* pdata, char* phash1);
25
26 /** Check mined proof-of-work block */
27 bool CheckWork(const std::shared_ptr<CBlock>& pblock, CWallet& wallet, CReserveKey& reservekey);
28
29 /** Check mined proof-of-stake block */
30 bool CheckStake(const std::shared_ptr<CBlock>& pblock, CWallet& wallet);
31
32 /** Base sha256 mining transform */
33 void SHA256Transform(void* pstate, void* pinput, const void* pinit);
34
35 /** Stake miner thread */
36 void ThreadStakeMiner(void* parg);
37
38 #endif // NOVACOIN_MINER_H