Skip to content

Commit fad13e9

Browse files
author
MarcoFalke
committed
rpcwallet: Make helper methods const on CWallet
1 parent fad40ec commit fad13e9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& reques
7070
return wallets.size() == 1 || (request.fHelp && wallets.size() > 0) ? wallets[0] : nullptr;
7171
}
7272

73-
std::string HelpRequiringPassphrase(CWallet * const pwallet)
73+
std::string HelpRequiringPassphrase(const CWallet* pwallet)
7474
{
7575
return pwallet && pwallet->IsCrypted()
7676
? "\nRequires wallet passphrase to be set with walletpassphrase call."
7777
: "";
7878
}
7979

80-
bool EnsureWalletIsAvailable(CWallet * const pwallet, bool avoidException)
80+
bool EnsureWalletIsAvailable(const CWallet* pwallet, bool avoidException)
8181
{
8282
if (pwallet) return true;
8383
if (avoidException) return false;
@@ -89,7 +89,7 @@ bool EnsureWalletIsAvailable(CWallet * const pwallet, bool avoidException)
8989
"Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).");
9090
}
9191

92-
void EnsureWalletIsUnlocked(CWallet * const pwallet)
92+
void EnsureWalletIsUnlocked(const CWallet* pwallet)
9393
{
9494
if (pwallet->IsLocked()) {
9595
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");

src/wallet/rpcwallet.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ void RegisterWalletRPCCommands(interfaces::Chain& chain, std::vector<std::unique
3131
*/
3232
std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& request);
3333

34-
std::string HelpRequiringPassphrase(CWallet *);
35-
void EnsureWalletIsUnlocked(CWallet *);
36-
bool EnsureWalletIsAvailable(CWallet *, bool avoidException);
34+
std::string HelpRequiringPassphrase(const CWallet*);
35+
void EnsureWalletIsUnlocked(const CWallet*);
36+
bool EnsureWalletIsAvailable(const CWallet*, bool avoidException);
3737

3838
UniValue getaddressinfo(const JSONRPCRequest& request);
3939
UniValue signrawtransactionwithwallet(const JSONRPCRequest& request);

0 commit comments

Comments
 (0)