|
|
@ -508,47 +508,47 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) |
|
|
|
} |
|
|
|
|
|
|
|
/*
|
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey) |
|
|
|
#else |
|
|
|
boost::optional<CScript> GetMinerScriptPubKey() |
|
|
|
#endif |
|
|
|
{ |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey) |
|
|
|
#else |
|
|
|
boost::optional<CScript> GetMinerScriptPubKey() |
|
|
|
#endif |
|
|
|
{ |
|
|
|
CKeyID keyID; |
|
|
|
CBitcoinAddress addr; |
|
|
|
if (addr.SetString(GetArg("-mineraddress", ""))) { |
|
|
|
addr.GetKeyID(keyID); |
|
|
|
} else { |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
CPubKey pubkey; |
|
|
|
if (!reservekey.GetReservedKey(pubkey)) { |
|
|
|
return boost::optional<CScript>(); |
|
|
|
} |
|
|
|
keyID = pubkey.GetID(); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return boost::optional<CScript>(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
CScript scriptPubKey = CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG; |
|
|
|
return scriptPubKey; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) |
|
|
|
{ |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) |
|
|
|
{ |
|
|
|
boost::optional<CScript> scriptPubKey = GetMinerScriptPubKey(reservekey); |
|
|
|
#else |
|
|
|
CBlockTemplate* CreateNewBlockWithKey() |
|
|
|
{ |
|
|
|
#else |
|
|
|
CBlockTemplate* CreateNewBlockWithKey() |
|
|
|
{ |
|
|
|
boost::optional<CScript> scriptPubKey = GetMinerScriptPubKey(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
if (!scriptPubKey) { |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
return CreateNewBlock(*scriptPubKey); |
|
|
|
}*/ |
|
|
|
}*/ |
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
@ -1109,14 +1109,14 @@ void static BitcoinMiner() |
|
|
|
} |
|
|
|
miningTimer.stop(); |
|
|
|
c.disconnect(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads) |
|
|
|
void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads) |
|
|
|
#else |
|
|
|
void GenerateBitcoins(bool fGenerate, int nThreads) |
|
|
|
void GenerateBitcoins(bool fGenerate, int nThreads) |
|
|
|
#endif |
|
|
|
{ |
|
|
|
{ |
|
|
|
static boost::thread_group* minerThreads = NULL; |
|
|
|
|
|
|
|
if (nThreads < 0) |
|
|
@ -1140,6 +1140,6 @@ void GenerateBitcoins(bool fGenerate, int nThreads) |
|
|
|
minerThreads->create_thread(&BitcoinMiner); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // ENABLE_MINING
|
|
|
|