Changeset View
Changeset View
Standalone View
Standalone View
src/qt/rpcconsole.cpp
Show All 18 Lines | |||||
#include "netbase.h" | #include "netbase.h" | ||||
#include "rpc/client.h" | #include "rpc/client.h" | ||||
#include "rpc/server.h" | #include "rpc/server.h" | ||||
#include "util.h" | #include "util.h" | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
#include "wallet/wallet.h" | |||||
#include <db_cxx.h> | #include <db_cxx.h> | ||||
#endif | #endif | ||||
#include <QKeyEvent> | #include <QKeyEvent> | ||||
#include <QMenu> | #include <QMenu> | ||||
#include <QMessageBox> | #include <QMessageBox> | ||||
#include <QScrollBar> | #include <QScrollBar> | ||||
#include <QSettings> | #include <QSettings> | ||||
▲ Show 20 Lines • Show All 277 Lines • ▼ Show 20 Lines | for (chpos = 0; chpos < strCommandTerminated.size(); ++chpos) { | ||||
// the method name to the dispatcher. | // the method name to the dispatcher. | ||||
JSONRPCRequest req; | JSONRPCRequest req; | ||||
req.params = RPCConvertValues( | req.params = RPCConvertValues( | ||||
stack.back()[0], | stack.back()[0], | ||||
std::vector<std::string>( | std::vector<std::string>( | ||||
stack.back().begin() + 1, | stack.back().begin() + 1, | ||||
stack.back().end())); | 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 | |||||
GlobalConfig config; | GlobalConfig config; | ||||
lastResult = tableRPC.execute(config, req); | lastResult = tableRPC.execute(config, req); | ||||
} | } | ||||
state = STATE_COMMAND_EXECUTED; | state = STATE_COMMAND_EXECUTED; | ||||
curarg.clear(); | curarg.clear(); | ||||
} | } | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 1,003 Lines • Show Last 20 Lines |