mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
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.
This commit is contained in:
parent
ccf790287c
commit
0c32b9c527
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue