PRCYCoin  2.0.0.7rc1
P2P Digital Currency
miner.h
Go to the documentation of this file.
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.
5 
6 #ifndef BITCOIN_MINER_H
7 #define BITCOIN_MINER_H
8 
9 #include "primitives/block.h"
10 
11 #include <stdint.h>
12 #include "key.h"
13 
14 class CBlock;
15 class CBlockHeader;
16 class CBlockIndex;
17 class CReserveKey;
18 class CScript;
19 class CWallet;
20 
21 struct CBlockTemplate;
22 
24 CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, const CPubKey& txPub, const CKey& txPriv, CWallet* pwallet, bool fProofOfStake);
25 
27 void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
29 void UpdateTime(CBlockHeader* block, const CBlockIndex* pindexPrev);
30 
31 #ifdef ENABLE_WALLET
32 
33  void GeneratePrcycoins(bool fGenerate, CWallet* pwallet, int nThreads);
35  CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey, CWallet* pwallet, bool fProofOfStake);
36 
38  void GeneratePoAPrcycoin(CWallet* pwallet, int period);
40  CBlockTemplate* CreateNewPoABlock(const CScript& scriptPubKeyIn, const CPubKey& txPub, const CKey& txPriv, CWallet* pwallet);
41  CBlockTemplate* CreateNewPoABlockWithKey(CReserveKey& reservekey, CWallet* pwallet);
42 
43  void BitcoinMiner(CWallet* pwallet, bool fProofOfStake);
44  void ThreadStakeMinter();
45 #endif // ENABLE_WALLET
46 
47 extern double dHashesPerSec;
48 extern int64_t nHPSTimerStart;
49 
52  std::vector<CAmount> vTxFees;
53  std::vector<int64_t> vTxSigOps;
54 };
55 
56 #endif // BITCOIN_MINER_H
block.h
CBlockHeader
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition: block.h:52
CReserveKey
A key allocated from the key pool.
Definition: wallet.h:679
dHashesPerSec
double dHashesPerSec
UpdateTime
void UpdateTime(CBlockHeader *block, const CBlockIndex *pindexPrev)
Check mined block.
Definition: miner.cpp:94
CScript
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:363
CBlockTemplate::vTxSigOps
std::vector< int64_t > vTxSigOps
Definition: miner.h:53
CBlock
Definition: block.h:142
key.h
CPubKey
An encapsulated public key.
Definition: pubkey.h:37
CBlockTemplate::vTxFees
std::vector< CAmount > vTxFees
Definition: miner.h:52
CKey
An encapsulated private key.
Definition: key.h:39
CBlockTemplate
Definition: miner.h:50
CWallet
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
Definition: wallet.h:243
IncrementExtraNonce
void IncrementExtraNonce(CBlock *pblock, CBlockIndex *pindexPrev, unsigned int &nExtraNonce)
Modify the extranonce in a block.
Definition: miner.cpp:609
CreateNewPoABlock
CBlockTemplate * CreateNewPoABlock(const CScript &scriptPubKeyIn, const CPubKey &txPub, const CKey &txPriv, CWallet *pwallet)
Definition: miner.cpp:509
CBlockIndex
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:162
nHPSTimerStart
int64_t nHPSTimerStart
CBlockTemplate::block
CBlock block
Definition: miner.h:51
CreateNewBlock
CBlockTemplate * CreateNewBlock(const CScript &scriptPubKeyIn, const CPubKey &txPub, const CKey &txPriv, CWallet *pwallet, bool fProofOfStake)
Generate a new block, without valid proof-of-work.
Definition: miner.cpp:160