Merge pull request #21 from lateminer/shared_ptr-fix

Use std::shared_ptr instead of boost::shared_ptr
This commit is contained in:
janko33bd
2018-01-12 08:41:32 +01:00
committed by GitHub
6 changed files with 9 additions and 14 deletions

View File

@@ -390,7 +390,7 @@ void static BitcoinMiner(const CChainParams& chainparams)
unsigned int nExtraNonce = 0;
boost::shared_ptr<CReserveScript> coinbaseScript;
std::shared_ptr<CReserveScript> coinbaseScript;
GetMainSignals().ScriptForMining(coinbaseScript);
try {

View File

@@ -28,7 +28,6 @@
#include <stdint.h>
#include <boost/assign/list_of.hpp>
#include <boost/shared_ptr.hpp>
#include <univalue.h>
@@ -141,7 +140,7 @@ UniValue generate(const UniValue& params, bool fHelp)
int nHeight = 0;
int nGenerate = params[0].get_int();
boost::shared_ptr<CReserveScript> coinbaseScript;
std::shared_ptr<CReserveScript> coinbaseScript;
GetMainSignals().ScriptForMining(coinbaseScript);
// If the keypool is exhausted, no script is returned at all. Catch this.

View File

@@ -20,7 +20,6 @@
#include <boost/foreach.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/signals2/signal.hpp>
#include <boost/thread.hpp>
#include <boost/algorithm/string/case_conv.hpp> // for to_upper()
@@ -36,7 +35,7 @@ static CCriticalSection cs_rpcWarmup;
static RPCTimerInterface* timerInterface = NULL;
/* Map of name to timer.
* @note Can be changed to std::unique_ptr when C++11 */
static std::map<std::string, boost::shared_ptr<RPCTimerBase> > deadlineTimers;
static std::map<std::string, std::shared_ptr<RPCTimerBase> > deadlineTimers;
static struct CRPCSignals
{
@@ -492,7 +491,7 @@ void RPCRunLater(const std::string& name, boost::function<void(void)> func, int6
throw JSONRPCError(RPC_INTERNAL_ERROR, "No timer handler registered for RPC");
deadlineTimers.erase(name);
LogPrint("rpc", "queue run of timer %s in %i seconds (using %s)\n", name, nSeconds, timerInterface->Name());
deadlineTimers.insert(std::make_pair(name, boost::shared_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000))));
deadlineTimers.insert(std::make_pair(name, std::shared_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000))));
}
CRPCTable tableRPC;

View File

@@ -7,7 +7,6 @@
#define BITCOIN_VALIDATIONINTERFACE_H
#include <boost/signals2/signal.hpp>
#include <boost/shared_ptr.hpp>
class CBlock;
struct CBlockLocator;
@@ -38,7 +37,7 @@ protected:
virtual void Inventory(const uint256 &hash) {}
virtual void ResendWalletTransactions(int64_t nBestBlockTime) {}
virtual void BlockChecked(const CBlock&, const CValidationState&) {}
virtual void GetScriptForMining(boost::shared_ptr<CReserveScript>&) {};
virtual void GetScriptForMining(std::shared_ptr<CReserveScript>&) {};
virtual void ResetRequestCount(const uint256 &hash) {};
friend void ::RegisterValidationInterface(CValidationInterface*);
friend void ::UnregisterValidationInterface(CValidationInterface*);
@@ -61,7 +60,7 @@ struct CMainSignals {
/** Notifies listeners of a block validation result */
boost::signals2::signal<void (const CBlock&, const CValidationState&)> BlockChecked;
/** Notifies listeners that a key for mining is required (coinbase) */
boost::signals2::signal<void (boost::shared_ptr<CReserveScript>&)> ScriptForMining;
boost::signals2::signal<void (std::shared_ptr<CReserveScript>&)> ScriptForMining;
/** Notifies listeners that a block has been successfully mined */
boost::signals2::signal<void (const uint256 &)> BlockFound;
};

View File

@@ -3473,9 +3473,9 @@ void CWallet::UpdatedTransaction(const uint256 &hashTx)
}
}
void CWallet::GetScriptForMining(boost::shared_ptr<CReserveScript> &script)
void CWallet::GetScriptForMining(std::shared_ptr<CReserveScript> &script)
{
boost::shared_ptr<CReserveKey> rKey(new CReserveKey(this));
std::shared_ptr<CReserveKey> rKey = std::make_shared<CReserveKey>(this);
CPubKey pubkey;
if (!rKey->GetReservedKey(pubkey))
return;

View File

@@ -26,8 +26,6 @@
#include <utility>
#include <vector>
#include <boost/shared_ptr.hpp>
extern CWallet* pwalletMain;
/**
@@ -763,7 +761,7 @@ public:
}
}
void GetScriptForMining(boost::shared_ptr<CReserveScript> &script);
void GetScriptForMining(std::shared_ptr<CReserveScript> &script);
void ResetRequestCount(const uint256 &hash)
{
LOCK(cs_wallet);