Skip to content

Commit 7161395

Browse files
committed
qt, rpc: Do not accept command while executing another one
1 parent 7f81974 commit 7161395

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
@@ -913,6 +913,10 @@ void RPCConsole::on_lineEdit_returnPressed()
913913
return;
914914
}
915915

916+
if (m_is_executing) {
917+
return;
918+
}
919+
916920
ui->lineEdit->clear();
917921

918922
#ifdef ENABLE_WALLET
@@ -931,6 +935,7 @@ void RPCConsole::on_lineEdit_returnPressed()
931935
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
932936
//: A message in the GUI console while an entered command being executed.
933937
message(CMD_REPLY, tr("Executing…"));
938+
m_is_executing = true;
934939
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
935940

936941
cmd = QString::fromStdString(strFilteredCmd);
@@ -982,6 +987,7 @@ void RPCConsole::startExecutor()
982987
ui->messagesWidget->undo();
983988
message(category, command);
984989
scrollToEnd();
990+
m_is_executing = false;
985991
});
986992

987993
// 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)