Replace auto_ptr with unique_ptr
This commit is contained in:
@@ -100,7 +100,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
{
|
{
|
||||||
const CChainParams& chainparams = Params();
|
const CChainParams& chainparams = Params();
|
||||||
// Create new block
|
// Create new block
|
||||||
auto_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
||||||
if(!pblocktemplate.get())
|
if(!pblocktemplate.get())
|
||||||
return NULL;
|
return NULL;
|
||||||
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
|
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
|
||||||
@@ -488,7 +488,7 @@ void static BitcoinMiner(CWallet *pwallet)
|
|||||||
unsigned int nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();
|
unsigned int nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();
|
||||||
CBlockIndex* pindexPrev = chainActive.Tip();
|
CBlockIndex* pindexPrev = chainActive.Tip();
|
||||||
|
|
||||||
auto_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
|
unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
|
||||||
if (!pblocktemplate.get())
|
if (!pblocktemplate.get())
|
||||||
{
|
{
|
||||||
LogPrintf("Error in ZcashMiner: Keypool ran out, please call keypoolrefill before restarting the mining thread\n");
|
LogPrintf("Error in ZcashMiner: Keypool ran out, please call keypoolrefill before restarting the mining thread\n");
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ Value generate(const Array& params, bool fHelp)
|
|||||||
unsigned int k = Params().EquihashK();
|
unsigned int k = Params().EquihashK();
|
||||||
while (nHeight < nHeightEnd)
|
while (nHeight < nHeightEnd)
|
||||||
{
|
{
|
||||||
auto_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
|
unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
|
||||||
if (!pblocktemplate.get())
|
if (!pblocktemplate.get())
|
||||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty");
|
throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty");
|
||||||
CBlock *pblock = &pblocktemplate->block;
|
CBlock *pblock = &pblocktemplate->block;
|
||||||
|
|||||||
Reference in New Issue
Block a user