Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | if (GetWalletNameFromJSONRPCRequest(request, wallet_name)) { | ||||
return pwallet; | return pwallet; | ||||
} | } | ||||
std::vector<std::shared_ptr<CWallet>> wallets = GetWallets(); | std::vector<std::shared_ptr<CWallet>> wallets = GetWallets(); | ||||
if (wallets.size() == 1) { | if (wallets.size() == 1) { | ||||
return wallets[0]; | return wallets[0]; | ||||
} | } | ||||
if (!HasWallets()) { | if (wallets.empty()) { | ||||
throw JSONRPCError(RPC_METHOD_NOT_FOUND, | throw JSONRPCError(RPC_METHOD_NOT_FOUND, | ||||
"Method not found (wallet method is disabled " | "Method not found (wallet method is disabled " | ||||
"because no wallet is loaded)"); | "because no wallet is loaded)"); | ||||
} | } | ||||
throw JSONRPCError(RPC_WALLET_NOT_SPECIFIED, | throw JSONRPCError(RPC_WALLET_NOT_SPECIFIED, | ||||
"Wallet file not specified (must request wallet RPC " | "Wallet file not specified (must request wallet RPC " | ||||
"through /wallet/<filename> uri-path)."); | "through /wallet/<filename> uri-path)."); | ||||
▲ Show 20 Lines • Show All 4,905 Lines • Show Last 20 Lines |