|
|
@ -63,6 +63,14 @@ const struct { |
|
|
|
{NULL, NULL} |
|
|
|
{NULL, NULL} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// don't add private key handling cmd's to the history
|
|
|
|
|
|
|
|
const QStringList RPCConsole::historyFilter = QStringList() |
|
|
|
|
|
|
|
<< "importprivkey" |
|
|
|
|
|
|
|
<< "signrawtransaction" |
|
|
|
|
|
|
|
<< "walletpassphrase" |
|
|
|
|
|
|
|
<< "walletpassphrasechange" |
|
|
|
|
|
|
|
<< "encryptwallet"; |
|
|
|
|
|
|
|
|
|
|
|
/* Object for executing console RPC commands in a separate thread.
|
|
|
|
/* Object for executing console RPC commands in a separate thread.
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class RPCExecutor : public QObject |
|
|
|
class RPCExecutor : public QObject |
|
|
@ -755,15 +763,26 @@ void RPCConsole::on_lineEdit_returnPressed() |
|
|
|
|
|
|
|
|
|
|
|
message(CMD_REQUEST, cmd); |
|
|
|
message(CMD_REQUEST, cmd); |
|
|
|
Q_EMIT cmdRequest(cmd); |
|
|
|
Q_EMIT cmdRequest(cmd); |
|
|
|
// Remove command, if already in history
|
|
|
|
|
|
|
|
history.removeOne(cmd); |
|
|
|
bool storeHistory = true; |
|
|
|
// Append command to history
|
|
|
|
Q_FOREACH(QString unallowedCmd, historyFilter) |
|
|
|
history.append(cmd); |
|
|
|
{ |
|
|
|
// Enforce maximum history size
|
|
|
|
if (cmd.trimmed().startsWith(unallowedCmd)) |
|
|
|
while(history.size() > CONSOLE_HISTORY) |
|
|
|
storeHistory = false; break; |
|
|
|
history.removeFirst(); |
|
|
|
} |
|
|
|
// Set pointer to end of history
|
|
|
|
|
|
|
|
historyPtr = history.size(); |
|
|
|
if (storeHistory) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Remove command, if already in history
|
|
|
|
|
|
|
|
history.removeOne(cmd); |
|
|
|
|
|
|
|
// Append command to history
|
|
|
|
|
|
|
|
history.append(cmd); |
|
|
|
|
|
|
|
// Enforce maximum history size
|
|
|
|
|
|
|
|
while(history.size() > CONSOLE_HISTORY) |
|
|
|
|
|
|
|
history.removeFirst(); |
|
|
|
|
|
|
|
// Set pointer to end of history
|
|
|
|
|
|
|
|
historyPtr = history.size(); |
|
|
|
|
|
|
|
} |
|
|
|
// Scroll console view to end
|
|
|
|
// Scroll console view to end
|
|
|
|
scrollToEnd(); |
|
|
|
scrollToEnd(); |
|
|
|
} |
|
|
|
} |
|
|
|