6 #if defined(HAVE_CONFIG_H) 11 #include "ui_debugwindow.h" 24 #include <openssl/crypto.h> 34 #include <QDesktopWidget> 37 #include <QMessageBox> 40 #include <QSignalMapper> 44 #include <QStringList> 46 #if QT_VERSION < 0x050000 60 const QString
RESCAN(
"-rescan");
61 const QString
ZAPTXES1(
"-zapwallettxes=1");
62 const QString
REINDEX(
"-reindex");
68 {
"cmd-request",
":/icons/tx_input"},
69 {
"cmd-reply",
":/icons/tx_output"},
70 {
"cmd-error",
":/icons/tx_output"},
71 {
"misc",
":/icons/tx_inout"},
78 const QStringList historyFilter = QStringList()
81 <<
"signmessagewithprivkey" 82 <<
"signrawtransaction" 84 <<
"walletpassphrasechange" 96 void request(
const QString &command);
99 void reply(
int category,
const QString &command);
112 timer.setSingleShot(
true);
113 connect(&timer, SIGNAL(timeout()),
this, SLOT(timeout()));
121 std::function<void(void)>
func;
128 const char *
Name() {
return "Qt"; }
136 #include "rpcconsole.moc" 159 std::vector< std::vector<std::string> > stack;
160 stack.push_back(std::vector<std::string>());
165 STATE_EATING_SPACES_IN_ARG,
166 STATE_EATING_SPACES_IN_BRACKETS,
171 STATE_ESCAPE_DOUBLEQUOTED,
172 STATE_COMMAND_EXECUTED,
173 STATE_COMMAND_EXECUTED_INNER
174 } state = STATE_EATING_SPACES;
177 unsigned nDepthInsideSensitive = 0;
178 size_t filter_begin_pos = 0, chpos;
179 std::vector<std::pair<size_t, size_t>> filter_ranges;
181 auto add_to_current_stack = [&](
const std::string& strArg) {
182 if (stack.back().empty() && (!nDepthInsideSensitive) && historyFilter.contains(QString::fromStdString(strArg), Qt::CaseInsensitive)) {
183 nDepthInsideSensitive = 1;
184 filter_begin_pos = chpos;
188 stack.
push_back(std::vector<std::string>());
190 stack.back().push_back(strArg);
193 auto close_out_params = [&]() {
194 if (nDepthInsideSensitive) {
195 if (!--nDepthInsideSensitive) {
196 assert(filter_begin_pos);
197 filter_ranges.push_back(std::make_pair(filter_begin_pos, chpos));
198 filter_begin_pos = 0;
204 std::string strCommandTerminated = strCommand;
205 if (strCommandTerminated.back() !=
'\n')
206 strCommandTerminated +=
"\n";
207 for (chpos = 0; chpos < strCommandTerminated.size(); ++chpos)
209 char ch = strCommandTerminated[chpos];
212 case STATE_COMMAND_EXECUTED_INNER:
213 case STATE_COMMAND_EXECUTED:
215 bool breakParsing =
true;
218 case '[': curarg.clear(); state = STATE_COMMAND_EXECUTED_INNER;
break;
220 if (state == STATE_COMMAND_EXECUTED_INNER)
228 if (curarg.size() && fExecute)
234 for(
char argch: curarg)
235 if (!std::isdigit(argch))
236 throw std::runtime_error(
"Invalid result query");
237 subelement = lastResult[
atoi(curarg.c_str())];
242 throw std::runtime_error(
"Invalid result query");
243 lastResult = subelement;
246 state = STATE_COMMAND_EXECUTED;
250 breakParsing =
false;
256 if (lastResult.
isStr())
259 curarg = lastResult.
write(2);
265 add_to_current_stack(curarg);
271 state = STATE_EATING_SPACES;
277 case STATE_EATING_SPACES_IN_ARG:
278 case STATE_EATING_SPACES_IN_BRACKETS:
279 case STATE_EATING_SPACES:
282 case '"': state = STATE_DOUBLEQUOTED;
break;
283 case '\'': state = STATE_SINGLEQUOTED;
break;
284 case '\\': state = STATE_ESCAPE_OUTER;
break;
285 case '(':
case ')':
case '\n':
286 if (state == STATE_EATING_SPACES_IN_ARG)
287 throw std::runtime_error(
"Invalid Syntax");
288 if (state == STATE_ARGUMENT)
290 if (ch ==
'(' && stack.size() && stack.back().size() > 0)
292 if (nDepthInsideSensitive) {
293 ++nDepthInsideSensitive;
295 stack.push_back(std::vector<std::string>());
300 throw std::runtime_error(
"Invalid Syntax");
302 add_to_current_stack(curarg);
304 state = STATE_EATING_SPACES_IN_BRACKETS;
306 if ((ch ==
')' || ch ==
'\n') && stack.size() > 0)
312 req.
params =
RPCConvertValues(stack.back()[0], std::vector<std::string>(stack.back().begin() + 1, stack.back().end()));
318 QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(
vpwallets[0]->GetName()));
319 req.
URI =
"/wallet/"+std::string(encodedName.constData(), encodedName.length());
325 state = STATE_COMMAND_EXECUTED;
329 case ' ':
case ',':
case '\t':
330 if(state == STATE_EATING_SPACES_IN_ARG && curarg.empty() && ch ==
',')
331 throw std::runtime_error(
"Invalid Syntax");
333 else if(state == STATE_ARGUMENT)
335 add_to_current_stack(curarg);
338 if ((state == STATE_EATING_SPACES_IN_BRACKETS || state == STATE_ARGUMENT) && ch ==
',')
340 state = STATE_EATING_SPACES_IN_ARG;
343 state = STATE_EATING_SPACES;
345 default: curarg += ch; state = STATE_ARGUMENT;
348 case STATE_SINGLEQUOTED:
351 case '\'': state = STATE_ARGUMENT;
break;
352 default: curarg += ch;
355 case STATE_DOUBLEQUOTED:
358 case '"': state = STATE_ARGUMENT;
break;
359 case '\\': state = STATE_ESCAPE_DOUBLEQUOTED;
break;
360 default: curarg += ch;
363 case STATE_ESCAPE_OUTER:
364 curarg += ch; state = STATE_ARGUMENT;
366 case STATE_ESCAPE_DOUBLEQUOTED:
367 if(ch !=
'"' && ch !=
'\\') curarg +=
'\\';
368 curarg += ch; state = STATE_DOUBLEQUOTED;
372 if (pstrFilteredOut) {
373 if (STATE_COMMAND_EXECUTED == state) {
374 assert(!stack.empty());
377 *pstrFilteredOut = strCommand;
378 for (
auto i = filter_ranges.rbegin(); i != filter_ranges.rend(); ++i) {
379 pstrFilteredOut->replace(i->first, i->second - i->first,
"(…)");
384 case STATE_COMMAND_EXECUTED:
385 if (lastResult.
isStr())
386 strResult = lastResult.
get_str();
388 strResult = lastResult.
write(2);
390 case STATE_EATING_SPACES:
402 std::string executableCommand = command.toStdString() +
"\n";
418 catch (
const std::runtime_error&)
423 catch (
const std::exception& e)
434 platformStyle(_platformStyle),
435 peersTableContextMenu(0),
436 banTableContextMenu(0),
441 if (!restoreGeometry(settings.value(
"RPCConsoleWindowGeometry").toByteArray())) {
443 move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center());
446 ui->openDebugLogfileButton->setToolTip(
ui->openDebugLogfileButton->toolTip().arg(tr(
PACKAGE_NAME)));
456 ui->lineEdit->installEventFilter(
this);
457 ui->messagesWidget->installEventFilter(
this);
459 connect(
ui->clearButton, SIGNAL(clicked()),
this, SLOT(
clear()));
460 connect(
ui->fontBiggerButton, SIGNAL(clicked()),
this, SLOT(
fontBigger()));
461 connect(
ui->fontSmallerButton, SIGNAL(clicked()),
this, SLOT(
fontSmaller()));
462 connect(
ui->btnClearTrafficGraph, SIGNAL(clicked()),
ui->trafficGraph, SLOT(
clear()));
465 connect(
ui->btn_rescan, SIGNAL(clicked()),
this, SLOT(
walletRescan()));
466 connect(
ui->btn_zapwallettxes1, SIGNAL(clicked()),
this, SLOT(
walletZaptxes1()));
467 connect(
ui->btn_reindex, SIGNAL(clicked()),
this, SLOT(
walletReindex()));
471 ui->berkeleyDBVersion->setText(DbEnv::version(0, 0, 0));
472 std::string walletPath =
GetDataDir().string();
473 walletPath += QDir::separator().toLatin1() +
gArgs.
GetArg(
"-wallet",
"wallet.dat");
474 ui->wallet_path->setText(QString::fromStdString(walletPath));
476 ui->label_berkeleyDBVersion->hide();
477 ui->berkeleyDBVersion->hide();
487 ui->detailWidget->hide();
488 ui->peerHeading->setText(tr(
"Select a peer to view detailed information."));
497 settings.setValue(
"RPCConsoleWindowGeometry", saveGeometry());
505 if(event->type() == QEvent::KeyPress)
507 QKeyEvent *keyevt =
static_cast<QKeyEvent*
>(event);
508 int key = keyevt->key();
509 Qt::KeyboardModifiers mod = keyevt->modifiers();
512 case Qt::Key_Up:
if(obj ==
ui->lineEdit) {
browseHistory(-1);
return true; }
break;
513 case Qt::Key_Down:
if(obj ==
ui->lineEdit) {
browseHistory(1);
return true; }
break;
515 case Qt::Key_PageDown:
516 if(obj ==
ui->lineEdit)
518 QApplication::postEvent(
ui->messagesWidget,
new QKeyEvent(*keyevt));
526 QApplication::postEvent(
ui->lineEdit,
new QKeyEvent(*keyevt));
533 if(obj ==
ui->messagesWidget && (
534 (!mod && !keyevt->text().isEmpty() && key != Qt::Key_Tab) ||
535 ((mod & Qt::ControlModifier) && key == Qt::Key_V) ||
536 ((mod & Qt::ShiftModifier) && key == Qt::Key_Insert)))
538 ui->lineEdit->setFocus();
539 QApplication::postEvent(
ui->lineEdit,
new QKeyEvent(*keyevt));
544 return QWidget::eventFilter(obj, event);
550 ui->trafficGraph->setClientModel(model);
554 connect(model, SIGNAL(numConnectionsChanged(
int)),
this, SLOT(
setNumConnections(
int)));
557 connect(model, SIGNAL(numBlocksChanged(
int,QDateTime,
double,
bool)),
this, SLOT(
setNumBlocks(
int,QDateTime,
double,
bool)));
560 connect(model, SIGNAL(networkActiveChanged(
bool)),
this, SLOT(
setNetworkActive(
bool)));
563 connect(model, SIGNAL(bytesChanged(quint64,quint64)),
this, SLOT(
updateTrafficStats(quint64, quint64)));
565 connect(model, SIGNAL(mempoolSizeChanged(
long,
size_t)),
this, SLOT(
setMempoolSize(
long,
size_t)));
569 ui->peerWidget->verticalHeader()->hide();
570 ui->peerWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
571 ui->peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
572 ui->peerWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
573 ui->peerWidget->setContextMenuPolicy(Qt::CustomContextMenu);
577 ui->peerWidget->horizontalHeader()->setStretchLastSection(
true);
580 QAction* disconnectAction =
new QAction(tr(
"&Disconnect"),
this);
581 QAction* banAction1h =
new QAction(tr(
"Ban for") +
" " + tr(
"1 &hour"),
this);
582 QAction* banAction24h =
new QAction(tr(
"Ban for") +
" " + tr(
"1 &day"),
this);
583 QAction* banAction7d =
new QAction(tr(
"Ban for") +
" " + tr(
"1 &week"),
this);
584 QAction* banAction365d =
new QAction(tr(
"Ban for") +
" " + tr(
"1 &year"),
this);
597 QSignalMapper* signalMapper =
new QSignalMapper(
this);
598 signalMapper->setMapping(banAction1h, 60*60);
599 signalMapper->setMapping(banAction24h, 60*60*24);
600 signalMapper->setMapping(banAction7d, 60*60*24*7);
601 signalMapper->setMapping(banAction365d, 60*60*24*365);
602 connect(banAction1h, SIGNAL(triggered()), signalMapper, SLOT(map()));
603 connect(banAction24h, SIGNAL(triggered()), signalMapper, SLOT(map()));
604 connect(banAction7d, SIGNAL(triggered()), signalMapper, SLOT(map()));
605 connect(banAction365d, SIGNAL(triggered()), signalMapper, SLOT(map()));
606 connect(signalMapper, SIGNAL(mapped(
int)),
this, SLOT(
banSelectedNode(
int)));
613 connect(
ui->peerWidget->selectionModel(), SIGNAL(selectionChanged(
const QItemSelection &,
const QItemSelection &)),
614 this, SLOT(
peerSelected(
const QItemSelection &,
const QItemSelection &)));
622 ui->banlistWidget->verticalHeader()->hide();
623 ui->banlistWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
624 ui->banlistWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
625 ui->banlistWidget->setSelectionMode(QAbstractItemView::SingleSelection);
626 ui->banlistWidget->setContextMenuPolicy(Qt::CustomContextMenu);
629 ui->banlistWidget->horizontalHeader()->setStretchLastSection(
true);
632 QAction* unbanAction =
new QAction(tr(
"&Unban"),
this);
639 connect(
ui->banlistWidget, SIGNAL(customContextMenuRequested(
const QPoint&)),
this, SLOT(
showBanTableContextMenu(
const QPoint&)));
643 connect(
ui->banlistWidget, SIGNAL(clicked(
const QModelIndex&)),
this, SLOT(
clearSelectedNode()));
653 ui->networkName->setText(QString::fromStdString(
Params().NetworkIDString()));
656 QStringList wordList;
658 for (
size_t i = 0; i < commandList.size(); ++i)
660 wordList << commandList[i].c_str();
661 wordList << (
"help " + commandList[i]).c_str();
666 autoCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel);
680 static QString categoryClass(
int category)
687 default:
return "misc";
710 QString str =
ui->messagesWidget->toHtml();
713 str.replace(QString(
"font-size:%1pt").arg(
consoleFontSize), QString(
"font-size:%1pt").arg(newSize));
720 float oldPosFactor = 1.0 /
ui->messagesWidget->verticalScrollBar()->maximum() *
ui->messagesWidget->verticalScrollBar()->value();
722 ui->messagesWidget->setHtml(str);
723 ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor *
ui->messagesWidget->verticalScrollBar()->maximum());
741 QString questionString = tr(
"Are you sure you want to reindex?");
742 questionString.append(QString(
"<br /><br />This process may take a few hours."));
745 confirmationDialog.
exec();
746 QMessageBox::StandardButton retval = (QMessageBox::StandardButton)confirmationDialog.result();
748 if(retval != QMessageBox::Yes)
760 QStringList args = QApplication::arguments();
777 ui->messagesWidget->clear();
783 ui->lineEdit->clear();
784 ui->lineEdit->setFocus();
790 ui->messagesWidget->document()->addResource(
791 QTextDocument::ImageResource,
798 ui->messagesWidget->document()->setDefaultStyleSheet(
801 "td.time { color: #808080; font-size: %2; padding-top: 3px; } " 802 "td.message { font-family: %1; font-size: %2; white-space:pre-wrap; } " 803 "td.cmd-request { color: #006060; } " 804 "td.cmd-error { color: red; } " 805 ".secwarning { color: red; }" 806 "b { color: #006060; } " 811 QString clsKey =
"(⌘)-L";
813 QString clsKey =
"Ctrl-L";
817 tr(
"Use up and down arrows to navigate history, and %1 to clear screen.").arg(
"<b>"+clsKey+
"</b>") +
"<br>" +
818 tr(
"Type <b>help</b> for an overview of available commands.")) +
819 "<br><span class=\"secwarning\">" +
820 tr(
"WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.") +
827 if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape)
835 QTime time = QTime::currentTime();
836 QString timeString = time.toString();
838 out +=
"<table><tr><td class=\"time\" width=\"65\">" + timeString +
"</td>";
839 out +=
"<td class=\"icon\" width=\"32\"><img src=\"" + categoryClass(category) +
"\"></td>";
840 out +=
"<td class=\"message " + categoryClass(category) +
"\" valign=\"middle\">";
845 out +=
"</td></tr></table>";
846 ui->messagesWidget->append(out);
856 connections +=
" (" + tr(
"Network activity disabled") +
")";
859 ui->numberOfConnections->setText(connections);
878 ui->numberOfBlocks->setText(QString::number(count));
879 ui->lastBlockTime->setText(blockDate.toString());
885 ui->mempoolNumberTxs->setText(QString::number(numberOfTxs));
887 if (dynUsage < 1000000)
888 ui->mempoolSize->setText(QString::number(dynUsage/1000.0,
'f', 2) +
" KB");
890 ui->mempoolSize->setText(QString::number(dynUsage/1000000.0,
'f', 2) +
" MB");
895 QString cmd =
ui->lineEdit->text();
899 std::string strFilteredCmd;
904 throw std::runtime_error(
"Invalid command line");
906 }
catch (
const std::exception& e) {
907 QMessageBox::critical(
this,
"Error", QString(
"Error: ") + QString::fromStdString(e.what()));
911 ui->lineEdit->clear();
918 cmd = QString::fromStdString(strFilteredCmd);
953 ui->lineEdit->setText(cmd);
959 executor->moveToThread(&
thread);
962 connect(executor, SIGNAL(reply(
int,QString)),
this, SLOT(
message(
int,QString)));
964 connect(
this, SIGNAL(
cmdRequest(QString)), executor, SLOT(request(QString)));
970 connect(&
thread, SIGNAL(finished()), executor, SLOT(deleteLater()), Qt::DirectConnection);
979 if (
ui->tabWidget->widget(index) ==
ui->tab_console)
980 ui->lineEdit->setFocus();
981 else if (
ui->tabWidget->widget(index) !=
ui->tab_peers)
992 QScrollBar *scrollbar =
ui->messagesWidget->verticalScrollBar();
993 scrollbar->setValue(scrollbar->maximum());
998 const int multiplier = 5;
999 int mins = value * multiplier;
1005 ui->trafficGraph->setGraphRangeMins(mins);
1017 Q_UNUSED(deselected);
1029 QModelIndexList selected =
ui->peerWidget->selectionModel()->selectedIndexes();
1031 for(
int i = 0; i < selected.size(); i++)
1044 bool fUnselect =
false;
1045 bool fReselect =
false;
1051 int selectedRow = -1;
1052 QModelIndexList selectedModelIndex =
ui->peerWidget->selectionModel()->selectedIndexes();
1053 if (!selectedModelIndex.isEmpty()) {
1054 selectedRow = selectedModelIndex.first().row();
1061 if (detailNodeRow < 0)
1068 if (detailNodeRow != selectedRow)
1079 if (fUnselect && selectedRow >= 0) {
1098 QString peerAddrDetails(QString::fromStdString(stats->
nodeStats.
addrName) +
" ");
1099 peerAddrDetails += tr(
"(node id: %1)").arg(QString::number(stats->
nodeStats.
nodeid));
1101 peerAddrDetails +=
"<br />" + tr(
"via %1").arg(QString::fromStdString(stats->
nodeStats.
addrLocal));
1102 ui->peerHeading->setText(peerAddrDetails);
1129 ui->peerSyncHeight->setText(tr(
"Unknown"));
1135 ui->peerCommonHeight->setText(tr(
"Unknown"));
1138 ui->detailWidget->show();
1143 QWidget::resizeEvent(event);
1148 QWidget::showEvent(event);
1159 QWidget::hideEvent(event);
1170 QModelIndex index =
ui->peerWidget->indexAt(point);
1171 if (index.isValid())
1177 QModelIndex index =
ui->banlistWidget->indexAt(point);
1178 if (index.isValid())
1189 for(
int i = 0; i < nodes.count(); i++)
1192 NodeId id = nodes.at(i).data().toLongLong();
1206 for(
int i = 0; i < nodes.count(); i++)
1209 NodeId id = nodes.at(i).data().toLongLong();
1213 if(detailNodeRow < 0)
1233 for(
int i = 0; i < nodes.count(); i++)
1236 QString strNode = nodes.at(i).data().toString();
1239 LookupSubNet(strNode.toStdString().c_str(), possibleSubnet);
1250 ui->peerWidget->selectionModel()->clearSelection();
1252 ui->detailWidget->hide();
1253 ui->peerHeading->setText(tr(
"Select a peer to view detailed information."));
1262 ui->banlistWidget->setVisible(visible);
1263 ui->banHeading->setVisible(visible);
1268 ui->tabWidget->setCurrentIndex(tabType);
QString formatClientStartupTime() const
int getRowByNodeId(NodeId nodeid)
const char * Name()
Implementation name.
RPCTimerBase * NewTimer(std::function< void(void)> &func, int64_t millis)
Factory function for timers.
QString formatSubVersion() const
void keyPressEvent(QKeyEvent *)
QString cmdBeforeBrowsing
CNodeStateStats nodeStateStats
bool getNetworkActive() const
Return true if network activity in core is enabled.
QList< QModelIndex > getEntryData(QAbstractItemView *view, int column)
Return a field of the currently selected entry as a QString.
void showEvent(QShowEvent *event)
void on_lineEdit_returnPressed()
void message(int category, const QString &message, bool html=false)
Append the message to the message widget.
static bool RPCExecuteCommandLine(std::string &strResult, const std::string &strCommand, std::string *const pstrFilteredOut=nullptr)
void showPeersTableContextMenu(const QPoint &point)
Show custom context menu on Peers tab.
RPCConsole(const PlatformStyle *platformStyle, QWidget *parent)
void setNetworkActive(bool networkActive)
Set network state shown in the UI.
void scrollToEnd()
Scroll console view to end.
const QString REINDEX("-reindex")
QString formatBytes(uint64_t bytes)
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
QString formatTimeOffset(int64_t nTimeOffset)
void clearSelectedNode()
clear the selected node
std::vector< CWalletRef > vpwallets
const std::string & get_str() const
QString HtmlEscape(const QString &str, bool fMultiLine)
quint64 getTotalBytesSent() const
PeerTableModel * getPeerTableModel()
void handleRestart(QStringList args)
Get restart command-line parameters and handle restart.
void disconnectSelectedNode()
Disconnect a selected node on the Peers tab.
void on_tabWidget_currentChanged(int index)
void updateNodeDetail(const CNodeCombinedStats *stats)
show detailed information on ui about selected node
void RPCUnsetTimerInterface(RPCTimerInterface *iface)
Unset factory function for timers.
const UniValue & find_value(const UniValue &obj, const std::string &name)
UniValue RPCConvertValues(const std::string &strMethod, const std::vector< std::string > &strParams)
Convert positional arguments to command-specific RPC representation.
void setClientModel(ClientModel *model)
void resizeEvent(QResizeEvent *event)
UniValue execute(const JSONRPCRequest &request) const
Execute a method.
const struct @18 ICON_MAPPING[]
void reply(int category, const QString &command)
void walletRescan()
Wallet repair options.
QMenu * peersTableContextMenu
void browseHistory(int offset)
Go forward or back in history.
bool fNodeStateStatsAvailable
bool push_back(const UniValue &val)
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
double getVerificationProgress(const CBlockIndex *tip) const
int64_t GetSystemTimeInSeconds()
Class for handling RPC timers (used for e.g.
QString formatDurationStr(int secs)
std::function< void(void)> func
const int CONSOLE_HISTORY
const QString RESCAN("-rescan")
quint64 getTotalBytesRecv() const
void buildParameterlist(QString arg)
Build parameter list for restart.
void walletReindex()
Restart wallet with "-reindex".
QtRPCTimerBase(std::function< void(void)> &_func, int64_t millis)
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
void request(const QString &command)
BanTableModel * getBanTableModel()
void peerLayoutChanged()
Handle updated peer information.
RPCTimerInterface * rpcTimerInterface
static bool RPCParseCommandLine(std::string &strResult, const std::string &strCommand, bool fExecute, std::string *const pstrFilteredOut=nullptr)
Split shell command line into a list of arguments and optionally execute the command(s).
void updateNetworkState()
Update UI with latest network info from model.
const CNodeCombinedStats * getNodeStats(int idx)
const QString ZAPTXES1("-zapwallettxes=1")
void on_openDebugLogfileButton_clicked()
open the debug.log from the current datadir
Model for Raven network client.
void unbanSelectedNode()
Unban a selected node on the Bans tab.
void hideEvent(QHideEvent *event)
ClientModel * clientModel
QString formatPingTime(double dPingTime)
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)
Set the factory function for timer, but only, if unset.
virtual bool eventFilter(QObject *obj, QEvent *event)
QMenu * banTableContextMenu
bool LookupSubNet(const char *pszName, CSubNet &ret)
void setTrafficGraphRange(int mins)
void clear(bool clearHistory=true)
QDateTime getLastBlockDate() const
void showOrHideBanTableIfRequired()
Hides ban table if no bans are present.
void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut)
update traffic statistics
QList< NodeId > cachedNodeids
void walletZaptxes1()
Restart wallet with "-zapwallettxes=1".
void setMempoolSize(long numberOfTxs, size_t dynUsage)
Set size (number of transactions and memory usage) of the mempool in the UI.
void setFontSize(int newSize)
void setNumConnections(int count)
Set number of connections shown in the UI.
const CChainParams & Params()
Return the currently selected parameters.
void peerLayoutAboutToChange()
Handle selection caching before update.
QString formatServicesStr(quint64 mask)
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
void on_sldGraphRange_valueChanged(int value)
change the time range of the network traffic graph
void banSelectedNode(int bantime)
Ban a selected node on the Peers tab.
Opaque base class for timers returned by NewTimerFunc.
const int INITIAL_TRAFFIC_GRAPH_MINS
std::unique_ptr< CConnman > g_connman
const char fontSizeSettingsKey[]
void peerSelected(const QItemSelection &selected, const QItemSelection &deselected)
Handle selection of peer in peers list.
const fs::path & GetDataDir(bool fNetSpecific)
const QSize FONT_RANGE(4, 40)
std::vector< std::string > listCommands() const
Returns a list of registered commands.
QCompleter * autoCompleter
void cmdRequest(const QString &command)
const PlatformStyle * platformStyle
void setNumBlocks(int count, const QDateTime &blockDate, double nVerificationProgress, bool headers)
Set number of blocks and last block date shown in the UI.
int atoi(const std::string &str)
void showBanTableContextMenu(const QPoint &point)
Show custom context menu on Bans tab.
QString formatFullVersion() const