@@ -74,14 +74,14 @@ const QStringList historyFilter = QStringList()
74
74
<< " walletpassphrasechange"
75
75
<< " encryptwallet" ;
76
76
77
- bool command_may_contain_sensitive_data (const QString cmd)
77
+ QString command_filter_sensitive_data (const QString cmd)
78
78
{
79
79
Q_FOREACH (QString unallowedCmd, historyFilter) {
80
80
if (cmd.trimmed ().startsWith (unallowedCmd)) {
81
- return true ;
81
+ return unallowedCmd ;
82
82
}
83
83
}
84
- return false ;
84
+ return cmd ;
85
85
}
86
86
87
87
}
@@ -779,20 +779,18 @@ void RPCConsole::on_lineEdit_returnPressed()
779
779
message (CMD_REQUEST, cmd);
780
780
Q_EMIT cmdRequest (cmd);
781
781
782
- bool storeHistory = !command_may_contain_sensitive_data (cmd);
782
+ cmd = command_filter_sensitive_data (cmd);
783
+
784
+ // Remove command, if already in history
785
+ history.removeOne (cmd);
786
+ // Append command to history
787
+ history.append (cmd);
788
+ // Enforce maximum history size
789
+ while (history.size () > CONSOLE_HISTORY)
790
+ history.removeFirst ();
791
+ // Set pointer to end of history
792
+ historyPtr = history.size ();
783
793
784
- if (storeHistory)
785
- {
786
- // Remove command, if already in history
787
- history.removeOne (cmd);
788
- // Append command to history
789
- history.append (cmd);
790
- // Enforce maximum history size
791
- while (history.size () > CONSOLE_HISTORY)
792
- history.removeFirst ();
793
- // Set pointer to end of history
794
- historyPtr = history.size ();
795
- }
796
794
// Scroll console view to end
797
795
scrollToEnd ();
798
796
}
0 commit comments