303 | @@ -304,9 +304,9 @@ bool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string &
304 | req.strMethod = stack.back()[0];
305 | #ifdef ENABLE_WALLET
306 | // TODO: Move this logic to WalletModel
307 | - if (!vpwallets.empty()) {
308 | + if (g_wallet_manager->HasWallets()) {
309 | // in Qt, use always the wallet with index 0 when running with multiple wallets
310 | - QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(vpwallets[0]->GetName()));
311 | + QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(g_wallet_manager->GetWalletAtPos(0)->GetName()));
Between the above call HasWallets() and GetWalletAtPos() the wallet can be unloaded. Not possible at the moment, but maybe we should take the opportunity to add a lock to g_wallet_manager?
Indeed. The locking would be the next step (not only for this case). But its out of scope for this PR.