MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / listwallets

Function listwallets

src/wallet/rpcwallet.cpp:3071–3101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3069}
3070
3071static UniValue listwallets(const JSONRPCRequest& request)
3072{
3073 if (request.fHelp || request.params.size() != 0)
3074 throw std::runtime_error(
3075 "listwallets\n"
3076 "Returns a list of currently loaded wallets.\n"
3077 "For full information on the wallet, use \"getwalletinfo\"\n"
3078 "\nResult:\n"
3079 "[ (json array of strings)\n"
3080 " \"walletname\" (string) the wallet name\n"
3081 " ...\n"
3082 "]\n"
3083 "\nExamples:\n"
3084 + HelpExampleCli("listwallets", "")
3085 + HelpExampleRpc("listwallets", "")
3086 );
3087
3088 UniValue obj(UniValue::VARR);
3089
3090 for (const std::shared_ptr<CWallet>& wallet : GetWallets()) {
3091 if (!EnsureWalletIsAvailable(wallet.get(), request.fHelp)) {
3092 return NullUniValue;
3093 }
3094
3095 LOCK(wallet->cs_wallet);
3096
3097 obj.push_back(wallet->GetName());
3098 }
3099
3100 return obj;
3101}
3102
3103static UniValue loadwallet(const JSONRPCRequest& request)
3104{

Callers

nothing calls this directly

Calls 8

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
GetWalletsFunction · 0.85
EnsureWalletIsAvailableFunction · 0.85
getMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected