Skip to content

Commit

Permalink
qt, rpc: Accept stop RPC even another command is executing
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed May 11, 2021
1 parent 614cc38 commit d4e7fcc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ void RPCConsole::setMempoolSize(long numberOfTxs, size_t dynUsage)

void RPCConsole::on_lineEdit_returnPressed()
{
QString cmd = ui->lineEdit->text();
QString cmd = ui->lineEdit->text().trimmed();

if (cmd.isEmpty()) {
return;
Expand All @@ -915,6 +915,13 @@ void RPCConsole::on_lineEdit_returnPressed()
return;
}

// A special case allows to request shutdown even a long-running command is executed.
if (cmd == QLatin1String("stop")) {
std::string dummy;
RPCExecuteCommandLine(m_node, dummy, cmd.toStdString());
return;
}

ui->lineEdit->clear();

#ifdef ENABLE_WALLET
Expand Down

0 comments on commit d4e7fcc

Please sign in to comment.