Skip to content

Commit d4e7fcc

Browse files
committed
qt, rpc: Accept stop RPC even another command is executing
1 parent 614cc38 commit d4e7fcc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/qt/rpcconsole.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ void RPCConsole::setMempoolSize(long numberOfTxs, size_t dynUsage)
897897

898898
void RPCConsole::on_lineEdit_returnPressed()
899899
{
900-
QString cmd = ui->lineEdit->text();
900+
QString cmd = ui->lineEdit->text().trimmed();
901901

902902
if (cmd.isEmpty()) {
903903
return;
@@ -915,6 +915,13 @@ void RPCConsole::on_lineEdit_returnPressed()
915915
return;
916916
}
917917

918+
// A special case allows to request shutdown even a long-running command is executed.
919+
if (cmd == QLatin1String("stop")) {
920+
std::string dummy;
921+
RPCExecuteCommandLine(m_node, dummy, cmd.toStdString());
922+
return;
923+
}
924+
918925
ui->lineEdit->clear();
919926

920927
#ifdef ENABLE_WALLET

0 commit comments

Comments
 (0)