mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
[Qt] Use wallet 0 in rpc console if running with multiple wallets
This commit is contained in:
parent
9e8d6a3fb4
commit
97375727b8
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
#include <db_cxx.h>
|
#include <db_cxx.h>
|
||||||
|
#include <wallet/wallet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
@ -301,6 +302,14 @@ bool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string &
|
|||||||
JSONRPCRequest req;
|
JSONRPCRequest req;
|
||||||
req.params = RPCConvertValues(stack.back()[0], std::vector<std::string>(stack.back().begin() + 1, stack.back().end()));
|
req.params = RPCConvertValues(stack.back()[0], std::vector<std::string>(stack.back().begin() + 1, stack.back().end()));
|
||||||
req.strMethod = stack.back()[0];
|
req.strMethod = stack.back()[0];
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
|
// TODO: Move this logic to WalletModel
|
||||||
|
if (!vpwallets.empty()) {
|
||||||
|
// in Qt, use always the wallet with index 0 when running with multiple wallets
|
||||||
|
QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(vpwallets[0]->GetName()));
|
||||||
|
req.URI = "/wallet/"+std::string(encodedName.constData(), encodedName.length());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
lastResult = tableRPC.execute(req);
|
lastResult = tableRPC.execute(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user