Switch miner to P2PKH, add -mineraddress option

Closes #945 and #1955.
This commit is contained in:
Jack Grigg
2016-12-23 17:30:27 +13:00
parent 2cc0a252ad
commit 8e8b6d701b
8 changed files with 282 additions and 38 deletions

View File

@@ -8,12 +8,15 @@
#include "primitives/block.h"
#include <boost/optional.hpp>
#include <stdint.h>
class CBlockIndex;
class CReserveKey;
class CScript;
#ifdef ENABLE_WALLET
class CReserveKey;
class CWallet;
#endif
namespace Consensus { struct Params; };
struct CBlockTemplate
@@ -25,11 +28,21 @@ struct CBlockTemplate
#ifdef ENABLE_MINING
/** Run the miner threads */
#ifdef ENABLE_WALLET
void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
#else
void GenerateBitcoins(bool fGenerate, int nThreads);
#endif
#endif
/** Generate a new block, without valid proof-of-work */
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
#ifdef ENABLE_WALLET
boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey);
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey);
#else
boost::optional<CScript> GetMinerScriptPubKey();
CBlockTemplate* CreateNewBlockWithKey();
#endif
/** Modify the extranonce in a block */
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);