Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ BITCOIN_CORE_H = \
uint256.h \
undo.h \
util/blockstatecatcher.h \
util/memory.h \
util/system.h \
util/macros.h \
util/string.h \
Expand Down
3 changes: 1 addition & 2 deletions src/httprpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "rpc/server.h"
#include "random.h"
#include "sync.h"
#include "util/memory.h"
#include "util/system.h"
#include "utilstrencodings.h"

Expand Down Expand Up @@ -234,7 +233,7 @@ bool StartHTTPRPC()
RegisterHTTPHandler("/wallet/", false, HTTPReq_JSONRPC);
#endif
assert(EventBase());
httpRPCTimerInterface = MakeUnique<HTTPRPCTimerInterface>(EventBase());
httpRPCTimerInterface = std::make_unique<HTTPRPCTimerInterface>(EventBase());
RPCSetTimerInterface(httpRPCTimerInterface.get());
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ bool AppInitMain()
// need to reindex later.

assert(!g_connman);
g_connman = MakeUnique<CConnman>(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max()));
g_connman = std::make_unique<CConnman>(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max()));
CConnman& connman = *g_connman;

peerLogic.reset(new PeerLogicValidation(&connman));
Expand Down
4 changes: 1 addition & 3 deletions src/interfaces/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <interfaces/handler.h>

#include <util/memory.h>

#include <boost/signals2/connection.hpp>
#include <utility>

Expand All @@ -27,7 +25,7 @@ class HandlerImpl : public Handler

std::unique_ptr<Handler> MakeHandler(boost::signals2::connection connection)
{
return MakeUnique<HandlerImpl>(std::move(connection));
return std::make_unique<HandlerImpl>(std::move(connection));
}

} // namespace interfaces
5 changes: 2 additions & 3 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "netmessagemaker.h"
#include "primitives/transaction.h"
#include "scheduler.h"
#include "util/memory.h"
#include "validation.h"

#ifdef WIN32
Expand Down Expand Up @@ -1983,7 +1982,7 @@ bool CConnman::Start(CScheduler& scheduler, std::string& strNodeError, Options c

if (semOutbound == nullptr) {
// initialize semaphore
semOutbound = MakeUnique<CSemaphore>(std::min((nMaxOutbound + nMaxFeeler), nMaxConnections));
semOutbound = std::make_unique<CSemaphore>(std::min((nMaxOutbound + nMaxFeeler), nMaxConnections));
}

if (pnodeLocalHost == nullptr) {
Expand Down Expand Up @@ -2330,7 +2329,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
nNextLocalAddrSend = 0;
nNextAddrSend = 0;
fRelayTxes = false;
pfilter = MakeUnique<CBloomFilter>();
pfilter = std::make_unique<CBloomFilter>();
timeLastMempoolReq = 0;
nPingNonceSent = 0;
nPingUsecStart = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/pivx/masternodeswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void MasterNodesWidget::onStartAllClicked(int type)
if (isLoading) {
inform(tr("Background task is being executed, please wait"));
} else {
std::unique_ptr<WalletModel::UnlockContext> pctx = MakeUnique<WalletModel::UnlockContext>(walletModel->requestUnlock());
std::unique_ptr<WalletModel::UnlockContext> pctx = std::make_unique<WalletModel::UnlockContext>(walletModel->requestUnlock());
if (!pctx->isValid()) {
warn(tr("Start ALL masternodes failed"), tr("Wallet unlock cancelled"));
return;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/pivx/send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void SendWidget::ProcessSend(QList<SendCoinsRecipient>& recipients, bool hasShie
}
}

auto ptrUnlockedContext = MakeUnique<WalletModel::UnlockContext>(walletModel->requestUnlock());
auto ptrUnlockedContext = std::make_unique<WalletModel::UnlockContext>(walletModel->requestUnlock());
if (!ptrUnlockedContext->isValid()) {
// Unlock wallet was cancelled
inform(tr("Cannot send, wallet locked"));
Expand Down
2 changes: 1 addition & 1 deletion src/qt/pivx/topbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ void TopBar::showUpgradeDialog(const QString& message)
{
QString title = tr("Wallet Upgrade");
if (ask(title, message)) {
std::unique_ptr<WalletModel::UnlockContext> pctx = MakeUnique<WalletModel::UnlockContext>(walletModel->requestUnlock());
std::unique_ptr<WalletModel::UnlockContext> pctx = std::make_unique<WalletModel::UnlockContext>(walletModel->requestUnlock());
if (!pctx->isValid()) {
warn(tr("Upgrade Wallet"), tr("Wallet unlock cancelled"));
return;
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ UniValue generate(const JSONRPCRequest& request)
EnsureWalletIsUnlocked(pwallet);
} else {
// Coinbase key
reservekey = MakeUnique<CReserveKey>(pwallet);
reservekey = std::make_unique<CReserveKey>(pwallet);
CPubKey pubkey;
if (!reservekey->GetReservedKey(pubkey)) throw JSONRPCError(RPC_INTERNAL_ERROR, "Error: Cannot get key from keypool");
coinbaseScript = GetScriptForDestination(pubkey.GetID());
Expand Down
3 changes: 1 addition & 2 deletions src/test/fuzz/fuzz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "chainparams.h"
#include "pubkey.h"
#include "util/memory.h"


static bool read_stdin(std::vector<uint8_t>& data)
Expand All @@ -25,7 +24,7 @@ static bool read_stdin(std::vector<uint8_t>& data)

static void initialize()
{
const static auto verify_handle = MakeUnique<ECCVerifyHandle>();
const static auto verify_handle = std::make_unique<ECCVerifyHandle>();
SelectParams(CBaseChainParams::MAIN);
}

Expand Down
3 changes: 1 addition & 2 deletions src/test/net_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "netbase.h"
#include "serialize.h"
#include "streams.h"
#include "util/memory.h"

#include "test/test_pivx.h"

Expand Down Expand Up @@ -198,7 +197,7 @@ BOOST_AUTO_TEST_CASE(ipv4_peer_with_ipv6_addrMe_test)
in_addr ipv4AddrPeer;
ipv4AddrPeer.s_addr = 0xa0b0c001;
CAddress addr = CAddress(CService(ipv4AddrPeer, 7777), NODE_NETWORK);
std::unique_ptr<CNode> pnode = MakeUnique<CNode>(0, NODE_NETWORK, 0, INVALID_SOCKET, addr, 0, 0, std::string{}, false);
std::unique_ptr<CNode> pnode = std::make_unique<CNode>(0, NODE_NETWORK, 0, INVALID_SOCKET, addr, 0, 0, std::string{}, false);
pnode->fSuccessfullyConnected.store(true);

// the peer claims to be reaching us via IPv6
Expand Down
3 changes: 1 addition & 2 deletions src/test/test_pivx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "script/sigcache.h"
#include "sporkdb.h"
#include "txmempool.h"
#include "util/memory.h"
#include "validation.h"

#include <boost/test/unit_test.hpp>
Expand Down Expand Up @@ -83,7 +82,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
GetMainSignals().RegisterBackgroundSignalScheduler(scheduler);

// Register EvoNotificationInterface
g_connman = MakeUnique<CConnman>(0x1337, 0x1337); // Deterministic randomness for tests.
g_connman = std::make_unique<CConnman>(0x1337, 0x1337); // Deterministic randomness for tests.
connman = g_connman.get();
pEvoNotificationInterface = new EvoNotificationInterface(*connman);
RegisterValidationInterface(pEvoNotificationInterface);
Expand Down
19 changes: 0 additions & 19 deletions src/util/memory.h

This file was deleted.

5 changes: 2 additions & 3 deletions src/wallet/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "guiinterfaceutil.h"
#include "hash.h"
#include "protocol.h"
#include "util/memory.h"
#include "util/system.h"
#include "utilstrencodings.h"
#include "wallet/walletutil.h"
Expand Down Expand Up @@ -463,7 +462,7 @@ CDB::CDB(CWalletDBWrapper& dbw, const char* pszMode, bool fFlushOnCloseIn) : pdb
pdb = env->mapDb[strFilename];
if (pdb == nullptr) {
int ret;
std::unique_ptr<Db> pdb_temp = MakeUnique<Db>(env->dbenv.get(), 0);
std::unique_ptr<Db> pdb_temp = std::make_unique<Db>(env->dbenv.get(), 0);

bool fMockDb = env->IsMock();
if (fMockDb) {
Expand Down Expand Up @@ -590,7 +589,7 @@ bool CDB::Rewrite(CWalletDBWrapper& dbw, const char* pszSkip)
std::string strFileRes = strFile + ".rewrite";
{ // surround usage of db with extra {}
CDB db(dbw, "r");
std::unique_ptr<Db> pdbCopy = MakeUnique<Db>(env->dbenv.get(), 0);
std::unique_ptr<Db> pdbCopy = std::make_unique<Db>(env->dbenv.get(), 0);

int ret = pdbCopy->open(NULL, // Txn pointer
strFileRes.c_str(), // Filename
Expand Down
1 change: 0 additions & 1 deletion src/wallet/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "clientversion.h"
#include "fs.h"
#include "util/memory.h"
#include "serialize.h"
#include "streams.h"
#include "sync.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct TestSaplingChainSetup: public TestChain100Setup
initZKSNARKS(); // init zk-snarks lib

bool fFirstRun;
pwalletMain = MakeUnique<CWallet>("testWallet", CWalletDBWrapper::CreateMock());
pwalletMain = std::make_unique<CWallet>("testWallet", CWalletDBWrapper::CreateMock());
pwalletMain->LoadWallet(fFirstRun);
RegisterValidationInterface(pwalletMain.get());

Expand Down
5 changes: 2 additions & 3 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "sapling/address.h"
#include "guiinterface.h"
#include "util/system.h"
#include "util/memory.h"
#include "utilstrencodings.h"
#include "validationinterface.h"
#include "script/ismine.h"
Expand Down Expand Up @@ -583,8 +582,8 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
bool fDecryptionThoroughlyChecked{false};

//! Key manager //
std::unique_ptr<ScriptPubKeyMan> m_spk_man = MakeUnique<ScriptPubKeyMan>(this);
std::unique_ptr<SaplingScriptPubKeyMan> m_sspk_man = MakeUnique<SaplingScriptPubKeyMan>(this);
std::unique_ptr<ScriptPubKeyMan> m_spk_man = std::make_unique<ScriptPubKeyMan>(this);
std::unique_ptr<SaplingScriptPubKeyMan> m_sspk_man = std::make_unique<SaplingScriptPubKeyMan>(this);

//! the current wallet version: clients below this version are not able to load the wallet
int nWalletVersion;
Expand Down