aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-03-20 05:01:27 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-31 23:34:04 +0300
commit38eb37c0bd29b4cb825de905e8eec87636a5221b (patch)
treec2d2d3943d24eb7150db5794a8f9f4f5937294ca /src/qt
parent0c32b9c5273a4933bda90aa9eb9b7eace6dcaa14 (diff)
downloadbitcoin-38eb37c0bd29b4cb825de905e8eec87636a5221b.tar.xz
qt, rpc: Do not accept command while executing another one
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/rpcconsole.cpp6
-rw-r--r--src/qt/rpcconsole.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index f9a53e8d60..c762f2b9c8 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -949,6 +949,10 @@ void RPCConsole::on_lineEdit_returnPressed()
return;
}
+ if (m_is_executing) {
+ return;
+ }
+
ui->lineEdit->clear();
#ifdef ENABLE_WALLET
@@ -967,6 +971,7 @@ void RPCConsole::on_lineEdit_returnPressed()
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
//: A console message indicating an entered command is currently being executed.
message(CMD_REPLY, tr("Executing…"));
+ m_is_executing = true;
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
cmd = QString::fromStdString(strFilteredCmd);
@@ -1018,6 +1023,7 @@ void RPCConsole::startExecutor()
ui->messagesWidget->undo();
message(category, command);
scrollToEnd();
+ m_is_executing = false;
});
// Requests from this object must go to executor
diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h
index 55a1decceb..75f466642b 100644
--- a/src/qt/rpcconsole.h
+++ b/src/qt/rpcconsole.h
@@ -166,6 +166,7 @@ private:
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();