Skip to content

Commit

Permalink
Begin Merge bitcoin#13017: refactor: Drop CWalletRef typedef
Browse files Browse the repository at this point in the history
Signed-off-by: Pasta <pasta@dashboost.org>
  • Loading branch information
promag authored and PastaPastaPasta committed Apr 14, 2020
1 parent 3333dee commit b0f08ae
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/wallet/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ bool WalletInit::Open()

void WalletInit::Start(CScheduler& scheduler)
{
for (CWalletRef pwallet : vpwallets) {
for (CWallet* pwallet : vpwallets) {
pwallet->postInitProcess();
}

Expand All @@ -322,21 +322,21 @@ void WalletInit::Flush()
privateSendClient.fPrivateSendRunning = false;
privateSendClient.ResetPool();
}
for (CWalletRef pwallet : vpwallets) {
for (CWallet* pwallet : vpwallets) {
pwallet->Flush(false);
}
}

void WalletInit::Stop()
{
for (CWalletRef pwallet : vpwallets) {
for (CWallet* pwallet : vpwallets) {
pwallet->Flush(true);
}
}

void WalletInit::Close()
{
for (CWalletRef pwallet : vpwallets) {
for (CWallet* pwallet : vpwallets) {
delete pwallet;
}
vpwallets.clear();
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CWallet *GetWalletForJSONRPCRequest(const JSONRPCRequest& request)
if (request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) {
// wallet endpoint was used
std::string requestedWallet = urlDecode(request.URI.substr(WALLET_ENDPOINT_BASE.size()));
for (CWalletRef pwallet : ::vpwallets) {
for (CWallet* pwallet : ::vpwallets) {
if (pwallet->GetName() == requestedWallet) {
return pwallet;
}
Expand Down Expand Up @@ -2812,7 +2812,7 @@ UniValue listwallets(const JSONRPCRequest& request)

UniValue obj(UniValue::VARR);

for (CWalletRef pwallet : vpwallets) {
for (CWallet* pwallet : vpwallets) {

if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {
return NullUniValue;
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <boost/algorithm/string/replace.hpp>
#include <boost/thread.hpp>

std::vector<CWalletRef> vpwallets;
std::vector<CWallet*> vpwallets;
/** Transaction fee set by the user */
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);
unsigned int nTxConfirmTarget = DEFAULT_TX_CONFIRM_TARGET;
Expand Down
3 changes: 1 addition & 2 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
#include <utility>
#include <vector>

typedef CWallet* CWalletRef;
extern std::vector<CWalletRef> vpwallets;
extern std::vector<CWallet*> vpwallets;

/**
* Settings
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/walletdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ void MaybeCompactWalletDB()
return;
}

for (CWalletRef pwallet : vpwallets) {
for (CWallet* pwallet : vpwallets) {
CWalletDBWrapper& dbh = pwallet->GetDBHandle();

unsigned int nUpdateCounter = dbh.nUpdateCounter;
Expand Down

0 comments on commit b0f08ae

Please sign in to comment.