Skip to content

Commit

Permalink
qt, rpc: Do not accept command while executing another one
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed May 11, 2021
1 parent d4e7fcc commit cb48c59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,10 @@ void RPCConsole::on_lineEdit_returnPressed()
return;
}

if (m_is_executing) {
return;
}

ui->lineEdit->clear();

#ifdef ENABLE_WALLET
Expand All @@ -940,6 +944,7 @@ void RPCConsole::on_lineEdit_returnPressed()
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
//: A message in the GUI console while an entered command being executed.
message(CMD_REPLY, tr("Executing…"));
m_is_executing = true;
Q_EMIT cmdRequest(cmd, m_last_wallet_model);

cmd = QString::fromStdString(strFilteredCmd);
Expand Down Expand Up @@ -991,6 +996,7 @@ void RPCConsole::startExecutor()
ui->messagesWidget->undo();
message(category, command);
scrollToEnd();
m_is_executing = false;
});

// Requests from this object must go to executor
Expand Down
1 change: 1 addition & 0 deletions src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public Q_SLOTS:
QCompleter *autoCompleter = nullptr;
QThread thread;
WalletModel* m_last_wallet_model{nullptr};
bool m_is_executing{false};

/** Update UI with latest network info from model. */
void updateNetworkState();
Expand Down

0 comments on commit cb48c59

Please sign in to comment.