diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 0d3e11f4a..199050cc5 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -415,8 +415,8 @@ void RPCConsole::on_lineEdit_returnPressed() { message(CMD_REQUEST, cmd); emit cmdRequest(cmd); - // Truncate history from current position - history.erase(history.begin() + historyPtr, history.end()); + // Remove command, if already in history + history.removeOne(cmd); // Append command to history history.append(cmd); // Enforce maximum history size