Skip to content

Commit b87a4cd

Browse files
committed
qt, rpc: Accept stop RPC even another command is executing
1 parent b816af3 commit b87a4cd

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/qt/rpcconsole.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,9 +888,9 @@ void RPCConsole::setMempoolSize(long numberOfTxs, size_t dynUsage)
888888

889889
void RPCConsole::on_lineEdit_returnPressed()
890890
{
891-
QString cmd = ui->lineEdit->text();
891+
QString cmd = ui->lineEdit->text().trimmed();
892892

893-
if (cmd.isEmpty() || m_is_executing) {
893+
if (cmd.isEmpty()) {
894894
return;
895895
}
896896

@@ -906,6 +906,16 @@ void RPCConsole::on_lineEdit_returnPressed()
906906
return;
907907
}
908908

909+
if (cmd == QLatin1String("stop")) {
910+
std::string dummy;
911+
RPCExecuteCommandLine(m_node, dummy, cmd.toStdString());
912+
return;
913+
}
914+
915+
if (m_is_executing) {
916+
return;
917+
}
918+
909919
ui->lineEdit->clear();
910920

911921
#ifdef ENABLE_WALLET

0 commit comments

Comments
 (0)