mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
Qt/Bugfix: fix handling default wallet with no name
This commit is contained in:
parent
d792e47421
commit
13c3a659c0
@ -312,7 +312,7 @@ bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strRes
|
|||||||
std::string method = stack.back()[0];
|
std::string method = stack.back()[0];
|
||||||
std::string uri;
|
std::string uri;
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
if (walletID && !walletID->empty()) {
|
if (walletID) {
|
||||||
QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(*walletID));
|
QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(*walletID));
|
||||||
uri = "/wallet/"+std::string(encodedName.constData(), encodedName.length());
|
uri = "/wallet/"+std::string(encodedName.constData(), encodedName.length());
|
||||||
}
|
}
|
||||||
@ -425,7 +425,7 @@ void RPCExecutor::request(const QString &command, const QString &walletID)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::string wallet_id = walletID.toStdString();
|
std::string wallet_id = walletID.toStdString();
|
||||||
if(!RPCConsole::RPCExecuteCommandLine(m_node, result, executableCommand, nullptr, &wallet_id))
|
if (!RPCConsole::RPCExecuteCommandLine(m_node, result, executableCommand, nullptr, walletID.isNull() ? nullptr : &wallet_id))
|
||||||
{
|
{
|
||||||
Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \""));
|
Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \""));
|
||||||
return;
|
return;
|
||||||
@ -909,7 +909,7 @@ void RPCConsole::on_lineEdit_returnPressed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_last_wallet_id != walletID) {
|
if (m_last_wallet_id != walletID) {
|
||||||
if (walletID.isEmpty()) {
|
if (walletID.isNull()) {
|
||||||
message(CMD_REQUEST, tr("Executing command without any wallet"));
|
message(CMD_REQUEST, tr("Executing command without any wallet"));
|
||||||
} else {
|
} else {
|
||||||
message(CMD_REQUEST, tr("Executing command using \"%1\" wallet").arg(walletID));
|
message(CMD_REQUEST, tr("Executing command using \"%1\" wallet").arg(walletID));
|
||||||
|
Loading…
Reference in New Issue
Block a user