diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-03-20 05:06:32 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-05-31 23:34:04 +0300 |
commit | 0c32b9c5273a4933bda90aa9eb9b7eace6dcaa14 (patch) | |
tree | 905b7487e84a4c735c584dd524af7ab27b495373 /src/qt/rpcconsole.cpp | |
parent | ccf790287c53edbc7b18983e07f520823436c003 (diff) |
qt, rpc: Accept stop RPC even another command is executing
While here, clean up the command input by calling the trimmed function
on the input from the command prompt.
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 1384c8e35a..f9a53e8d60 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -924,7 +924,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; @@ -942,6 +942,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 |