Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,206 Lines • ▼ Show 20 Lines | static UniValue loadwallet(const Config &config, | ||||
std::shared_ptr<CWallet> const wallet = | std::shared_ptr<CWallet> const wallet = | ||||
LoadWallet(chainParams, *context.chain, location, error, warnings); | LoadWallet(chainParams, *context.chain, location, error, warnings); | ||||
if (!wallet) { | if (!wallet) { | ||||
throw JSONRPCError(RPC_WALLET_ERROR, error.original); | throw JSONRPCError(RPC_WALLET_ERROR, error.original); | ||||
} | } | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
obj.pushKV("name", wallet->GetName()); | obj.pushKV("name", wallet->GetName()); | ||||
obj.pushKV("warning", Join(warnings, "\n", OpOriginal)); | obj.pushKV("warning", Join(warnings, Untranslated("\n")).original); | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue setwalletflag(const Config &config, | static UniValue setwalletflag(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | switch (status) { | ||||
throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, error.original); | throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, error.original); | ||||
case WalletCreationStatus::SUCCESS: | case WalletCreationStatus::SUCCESS: | ||||
break; | break; | ||||
// no default case, so the compiler can warn about missing cases | // no default case, so the compiler can warn about missing cases | ||||
} | } | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
obj.pushKV("name", wallet->GetName()); | obj.pushKV("name", wallet->GetName()); | ||||
obj.pushKV("warning", Join(warnings, "\n", OpOriginal)); | obj.pushKV("warning", Join(warnings, Untranslated("\n")).original); | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue unloadwallet(const Config &config, | static UniValue unloadwallet(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"unloadwallet", | "unloadwallet", | ||||
▲ Show 20 Lines • Show All 1,671 Lines • Show Last 20 Lines |