File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,28 @@ const struct {
63
63
{NULL , NULL }
64
64
};
65
65
66
+ namespace {
67
+
66
68
// don't add private key handling cmd's to the history
67
- const QStringList RPCConsole:: historyFilter = QStringList()
69
+ const QStringList historyFilter = QStringList()
68
70
<< " importprivkey"
69
71
<< " signrawtransaction"
70
72
<< " walletpassphrase"
71
73
<< " walletpassphrasechange"
72
74
<< " encryptwallet" ;
73
75
76
+ bool command_may_contain_sensitive_data (const QString cmd)
77
+ {
78
+ Q_FOREACH (QString unallowedCmd, historyFilter) {
79
+ if (cmd.trimmed ().startsWith (unallowedCmd)) {
80
+ return true ;
81
+ }
82
+ }
83
+ return false ;
84
+ }
85
+
86
+ }
87
+
74
88
/* Object for executing console RPC commands in a separate thread.
75
89
*/
76
90
class RPCExecutor : public QObject
@@ -764,15 +778,7 @@ void RPCConsole::on_lineEdit_returnPressed()
764
778
message (CMD_REQUEST, cmd);
765
779
Q_EMIT cmdRequest (cmd);
766
780
767
- bool storeHistory = true ;
768
- Q_FOREACH (QString unallowedCmd, historyFilter)
769
- {
770
- if (cmd.trimmed ().startsWith (unallowedCmd))
771
- {
772
- storeHistory = false ;
773
- break ;
774
- }
775
- }
781
+ bool storeHistory = !command_may_contain_sensitive_data (cmd);
776
782
777
783
if (storeHistory)
778
784
{
Original file line number Diff line number Diff line change @@ -140,7 +140,6 @@ public Q_SLOTS:
140
140
ClientModel *clientModel;
141
141
QStringList history;
142
142
int historyPtr;
143
- const static QStringList historyFilter;
144
143
QString cmdBeforeBrowsing;
145
144
QList<NodeId> cachedNodeids;
146
145
const PlatformStyle *platformStyle;
You can’t perform that action at this time.
0 commit comments