mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
qt, rpc: Do not accept command while executing another one
This commit is contained in:
parent
0c32b9c527
commit
38eb37c0bd
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue