mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
rpcwallet: Make helper methods const on CWallet
This commit is contained in:
parent
fad40ec915
commit
fad13e925e
2 changed files with 6 additions and 6 deletions
|
@ -70,14 +70,14 @@ std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& reques
|
|||
return wallets.size() == 1 || (request.fHelp && wallets.size() > 0) ? wallets[0] : nullptr;
|
||||
}
|
||||
|
||||
std::string HelpRequiringPassphrase(CWallet * const pwallet)
|
||||
std::string HelpRequiringPassphrase(const CWallet* pwallet)
|
||||
{
|
||||
return pwallet && pwallet->IsCrypted()
|
||||
? "\nRequires wallet passphrase to be set with walletpassphrase call."
|
||||
: "";
|
||||
}
|
||||
|
||||
bool EnsureWalletIsAvailable(CWallet * const pwallet, bool avoidException)
|
||||
bool EnsureWalletIsAvailable(const CWallet* pwallet, bool avoidException)
|
||||
{
|
||||
if (pwallet) return true;
|
||||
if (avoidException) return false;
|
||||
|
@ -89,7 +89,7 @@ bool EnsureWalletIsAvailable(CWallet * const pwallet, bool avoidException)
|
|||
"Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).");
|
||||
}
|
||||
|
||||
void EnsureWalletIsUnlocked(CWallet * const pwallet)
|
||||
void EnsureWalletIsUnlocked(const CWallet* pwallet)
|
||||
{
|
||||
if (pwallet->IsLocked()) {
|
||||
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
|
||||
|
|
|
@ -31,9 +31,9 @@ void RegisterWalletRPCCommands(interfaces::Chain& chain, std::vector<std::unique
|
|||
*/
|
||||
std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& request);
|
||||
|
||||
std::string HelpRequiringPassphrase(CWallet *);
|
||||
void EnsureWalletIsUnlocked(CWallet *);
|
||||
bool EnsureWalletIsAvailable(CWallet *, bool avoidException);
|
||||
std::string HelpRequiringPassphrase(const CWallet*);
|
||||
void EnsureWalletIsUnlocked(const CWallet*);
|
||||
bool EnsureWalletIsAvailable(const CWallet*, bool avoidException);
|
||||
|
||||
UniValue getaddressinfo(const JSONRPCRequest& request);
|
||||
UniValue signrawtransactionwithwallet(const JSONRPCRequest& request);
|
||||
|
|
Loading…
Reference in a new issue