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 Nov 15, 2020
1 parent 1d46daa commit e8753bf
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,9 @@ 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() || m_is_executing) {
if (cmd.isEmpty()) {
return;
}

Expand All @@ -906,6 +906,16 @@ void RPCConsole::on_lineEdit_returnPressed()
return;
}

if (cmd.startsWith("stop")) {
std::string dummy;
RPCExecuteCommandLine(m_node, dummy, cmd.toStdString());
return;
}

if (m_is_executing) {
return;
}

ui->lineEdit->clear();

#ifdef ENABLE_WALLET
Expand Down

0 comments on commit e8753bf

Please sign in to comment.