Skip to content

Commit df389bc

Browse files
committed
Change wallet method disabled error text
Not strictly backwards compatible because the error is not new in this release.
1 parent e526b3d commit df389bc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ bool EnsureWalletIsAvailable(CWallet * const pwallet, bool avoidException)
6060
if (pwallet) return true;
6161
if (avoidException) return false;
6262
if (::vpwallets.empty()) {
63-
// Wallet RPC methods are disabled if no wallets are loaded.
64-
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)");
63+
// Note: It isn't currently possible to trigger this error because
64+
// wallet RPC methods aren't registered unless a wallet is loaded. But
65+
// this error is being kept as a precaution, because it's possible in
66+
// the future that wallet RPC methods might get or remain registered
67+
// when no wallets are loaded.
68+
throw JSONRPCError(
69+
RPC_METHOD_NOT_FOUND, "Method not found (wallet method is disabled because no wallet is loaded)");
6570
}
6671
throw JSONRPCError(RPC_WALLET_NOT_SPECIFIED,
6772
"Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).");

0 commit comments

Comments
 (0)