Skip to content

Commit cb48c59

Browse files
committed
qt, rpc: Do not accept command while executing another one
1 parent d4e7fcc commit cb48c59

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/qt/rpcconsole.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,10 @@ void RPCConsole::on_lineEdit_returnPressed()
922922
return;
923923
}
924924

925+
if (m_is_executing) {
926+
return;
927+
}
928+
925929
ui->lineEdit->clear();
926930

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

945950
cmd = QString::fromStdString(strFilteredCmd);
@@ -991,6 +996,7 @@ void RPCConsole::startExecutor()
991996
ui->messagesWidget->undo();
992997
message(category, command);
993998
scrollToEnd();
999+
m_is_executing = false;
9941000
});
9951001

9961002
// Requests from this object must go to executor

src/qt/rpcconsole.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public Q_SLOTS:
165165
QCompleter *autoCompleter = nullptr;
166166
QThread thread;
167167
WalletModel* m_last_wallet_model{nullptr};
168+
bool m_is_executing{false};
168169

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

0 commit comments

Comments
 (0)