| 161 | } |
| 162 | |
| 163 | static RPCHelpMan listwallets() |
| 164 | { |
| 165 | return RPCHelpMan{"listwallets", |
| 166 | "Returns a list of currently loaded wallets.\n" |
| 167 | "For full information on the wallet, use \"getwalletinfo\"\n", |
| 168 | {}, |
| 169 | RPCResult{ |
| 170 | RPCResult::Type::ARR, "", "", |
| 171 | { |
| 172 | {RPCResult::Type::STR, "walletname", "the wallet name"}, |
| 173 | } |
| 174 | }, |
| 175 | RPCExamples{ |
| 176 | HelpExampleCli("listwallets", "") |
| 177 | + HelpExampleRpc("listwallets", "") |
| 178 | }, |
| 179 | [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue |
| 180 | { |
| 181 | UniValue obj(UniValue::VARR); |
| 182 | |
| 183 | WalletContext& context = EnsureWalletContext(request.context); |
| 184 | for (const std::shared_ptr<CWallet>& wallet : GetWallets(context)) { |
| 185 | LOCK(wallet->cs_wallet); |
| 186 | obj.push_back(wallet->GetName()); |
| 187 | } |
| 188 | |
| 189 | return obj; |
| 190 | }, |
| 191 | }; |
| 192 | } |
| 193 | |
| 194 | static RPCHelpMan loadwallet() |
| 195 | { |
nothing calls this directly
no test coverage detected