Skip to content

Commit 38eb37c

Browse files
committed
qt, rpc: Do not accept command while executing another one
1 parent 0c32b9c commit 38eb37c

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
@@ -949,6 +949,10 @@ void RPCConsole::on_lineEdit_returnPressed()
949949
return;
950950
}
951951

952+
if (m_is_executing) {
953+
return;
954+
}
955+
952956
ui->lineEdit->clear();
953957

954958
#ifdef ENABLE_WALLET
@@ -967,6 +971,7 @@ void RPCConsole::on_lineEdit_returnPressed()
967971
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
968972
//: A console message indicating an entered command is currently being executed.
969973
message(CMD_REPLY, tr("Executing…"));
974+
m_is_executing = true;
970975
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
971976

972977
cmd = QString::fromStdString(strFilteredCmd);
@@ -1018,6 +1023,7 @@ void RPCConsole::startExecutor()
10181023
ui->messagesWidget->undo();
10191024
message(category, command);
10201025
scrollToEnd();
1026+
m_is_executing = false;
10211027
});
10221028

10231029
// 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
@@ -166,6 +166,7 @@ public Q_SLOTS:
166166
QCompleter *autoCompleter = nullptr;
167167
QThread thread;
168168
WalletModel* m_last_wallet_model{nullptr};
169+
bool m_is_executing{false};
169170

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

0 commit comments

Comments
 (0)