5 #if defined(HAVE_CONFIG_H)    10 #include <qt/forms/ui_debugwindow.h>    23 #include <openssl/crypto.h>    32 #include <QDesktopWidget>    35 #include <QMessageBox>    38 #include <QSignalMapper>    41 #include <QStringList>    56     {
"cmd-request", 
":/icons/tx_input"},
    57     {
"cmd-reply", 
":/icons/tx_output"},
    58     {
"cmd-error", 
":/icons/tx_output"},
    59     {
"misc", 
":/icons/tx_inout"},
    66 const QStringList historyFilter = QStringList()
    70     << 
"signmessagewithprivkey"    71     << 
"signrawtransaction"    72     << 
"signrawtransactionwithkey"    74     << 
"walletpassphrasechange"    88     void request(
const QString &command, 
const QString &walletID);
    91     void reply(
int category, 
const QString &command);
   107         timer.setSingleShot(
true);
   108         connect(&
timer, &QTimer::timeout, [
this]{ 
func(); });
   121     const char *
Name() { 
return "Qt"; }
   129 #include <qt/rpcconsole.moc>   153     std::vector< std::vector<std::string> > stack;
   154     stack.push_back(std::vector<std::string>());
   159         STATE_EATING_SPACES_IN_ARG,
   160         STATE_EATING_SPACES_IN_BRACKETS,
   165         STATE_ESCAPE_DOUBLEQUOTED,
   166         STATE_COMMAND_EXECUTED,
   167         STATE_COMMAND_EXECUTED_INNER
   168     } state = STATE_EATING_SPACES;
   171     unsigned nDepthInsideSensitive = 0;
   172     size_t filter_begin_pos = 0, chpos;
   173     std::vector<std::pair<size_t, size_t>> filter_ranges;
   175     auto add_to_current_stack = [&](
const std::string& strArg) {
   176         if (stack.back().empty() && (!nDepthInsideSensitive) && historyFilter.contains(QString::fromStdString(strArg), Qt::CaseInsensitive)) {
   177             nDepthInsideSensitive = 1;
   178             filter_begin_pos = chpos;
   182             stack.
push_back(std::vector<std::string>());
   184         stack.back().push_back(strArg);
   187     auto close_out_params = [&]() {
   188         if (nDepthInsideSensitive) {
   189             if (!--nDepthInsideSensitive) {
   190                 assert(filter_begin_pos);
   191                 filter_ranges.push_back(std::make_pair(filter_begin_pos, chpos));
   192                 filter_begin_pos = 0;
   198     std::string strCommandTerminated = strCommand;
   199     if (strCommandTerminated.back() != 
'\n')
   200         strCommandTerminated += 
"\n";
   201     for (chpos = 0; chpos < strCommandTerminated.size(); ++chpos)
   203         char ch = strCommandTerminated[chpos];
   206             case STATE_COMMAND_EXECUTED_INNER:
   207             case STATE_COMMAND_EXECUTED:
   209                 bool breakParsing = 
true;
   212                     case '[': curarg.clear(); state = STATE_COMMAND_EXECUTED_INNER; 
break;
   214                         if (state == STATE_COMMAND_EXECUTED_INNER)
   222                             if (curarg.size() && fExecute)
   228                                     for(
char argch: curarg)
   229                                         if (!std::isdigit(argch))
   230                                             throw std::runtime_error(
"Invalid result query");
   231                                     subelement = lastResult[
atoi(curarg.c_str())];
   236                                     throw std::runtime_error(
"Invalid result query"); 
   237                                 lastResult = subelement;
   240                             state = STATE_COMMAND_EXECUTED;
   244                         breakParsing = 
false;
   250                         if (lastResult.
isStr())
   253                             curarg = lastResult.
write(2);
   259                                 add_to_current_stack(curarg);
   265                         state = STATE_EATING_SPACES;
   271             case STATE_EATING_SPACES_IN_ARG:
   272             case STATE_EATING_SPACES_IN_BRACKETS:
   273             case STATE_EATING_SPACES: 
   276                 case '"': state = STATE_DOUBLEQUOTED; 
break;
   277                 case '\'': state = STATE_SINGLEQUOTED; 
break;
   278                 case '\\': state = STATE_ESCAPE_OUTER; 
break;
   279                 case '(': 
case ')': 
case '\n':
   280                     if (state == STATE_EATING_SPACES_IN_ARG)
   281                         throw std::runtime_error(
"Invalid Syntax");
   282                     if (state == STATE_ARGUMENT)
   284                         if (ch == 
'(' && stack.size() && stack.back().size() > 0)
   286                             if (nDepthInsideSensitive) {
   287                                 ++nDepthInsideSensitive;
   289                             stack.push_back(std::vector<std::string>());
   294                             throw std::runtime_error(
"Invalid Syntax");
   296                         add_to_current_stack(curarg);
   298                         state = STATE_EATING_SPACES_IN_BRACKETS;
   300                     if ((ch == 
')' || ch == 
'\n') && stack.size() > 0)
   305                             UniValue params = 
RPCConvertValues(stack.back()[0], std::vector<std::string>(stack.back().begin() + 1, stack.back().end()));
   306                             std::string method = stack.back()[0];
   310                                 QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(*walletID));
   311                                 uri = 
"/wallet/"+std::string(encodedName.constData(), encodedName.length());
   315                             lastResult = node->
executeRpc(method, params, uri);
   318                         state = STATE_COMMAND_EXECUTED;
   322                 case ' ': 
case ',': 
case '\t':
   323                     if(state == STATE_EATING_SPACES_IN_ARG && curarg.empty() && ch == 
',')
   324                         throw std::runtime_error(
"Invalid Syntax");
   326                     else if(state == STATE_ARGUMENT) 
   328                         add_to_current_stack(curarg);
   331                     if ((state == STATE_EATING_SPACES_IN_BRACKETS || state == STATE_ARGUMENT) && ch == 
',')
   333                         state = STATE_EATING_SPACES_IN_ARG;
   336                     state = STATE_EATING_SPACES;
   338                 default: curarg += ch; state = STATE_ARGUMENT;
   341             case STATE_SINGLEQUOTED: 
   344                 case '\'': state = STATE_ARGUMENT; 
break;
   345                 default: curarg += ch;
   348             case STATE_DOUBLEQUOTED: 
   351                 case '"': state = STATE_ARGUMENT; 
break;
   352                 case '\\': state = STATE_ESCAPE_DOUBLEQUOTED; 
break;
   353                 default: curarg += ch;
   356             case STATE_ESCAPE_OUTER: 
   357                 curarg += ch; state = STATE_ARGUMENT;
   359             case STATE_ESCAPE_DOUBLEQUOTED: 
   360                 if(ch != 
'"' && ch != 
'\\') curarg += 
'\\'; 
   361                 curarg += ch; state = STATE_DOUBLEQUOTED;
   365     if (pstrFilteredOut) {
   366         if (STATE_COMMAND_EXECUTED == state) {
   367             assert(!stack.empty());
   370         *pstrFilteredOut = strCommand;
   371         for (
auto i = filter_ranges.rbegin(); i != filter_ranges.rend(); ++i) {
   372             pstrFilteredOut->replace(i->first, i->second - i->first, 
"(…)");
   377         case STATE_COMMAND_EXECUTED:
   378             if (lastResult.
isStr())
   379                 strResult = lastResult.
get_str();
   381                 strResult = lastResult.
write(2);
   383         case STATE_EATING_SPACES:
   395         std::string executableCommand = command.toStdString() + 
"\n";
   398         if(executableCommand == 
"help-console\n")
   401                 "This console accepts RPC commands using the standard syntax.\n"   402                 "   example:    getblockhash 0\n\n"   404                 "This console can also accept RPC commands using parenthesized syntax.\n"   405                 "   example:    getblockhash(0)\n\n"   407                 "Commands may be nested when specified with the parenthesized syntax.\n"   408                 "   example:    getblock(getblockhash(0) 1)\n\n"   410                 "A space or a comma can be used to delimit arguments for either syntax.\n"   411                 "   example:    getblockhash 0\n"   412                 "               getblockhash,0\n\n"   414                 "Named results can be queried with a non-quoted key string in brackets.\n"   415                 "   example:    getblock(getblockhash(0) true)[tx]\n\n"   417                 "Results without keys can be queried using an integer in brackets.\n"   418                 "   example:    getblock(getblockhash(0),true)[tx][0]\n\n")));
   421         std::string wallet_id = walletID.toStdString();
   438         catch (
const std::runtime_error&) 
   443     catch (
const std::exception& e)
   453     platformStyle(_platformStyle)
   457     if (!restoreGeometry(settings.value(
"RPCConsoleWindowGeometry").toByteArray())) {
   459         move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center());
   462     QChar nonbreaking_hyphen(8209);
   463     ui->dataDir->setToolTip(
ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + 
"datadir"));
   464     ui->blocksDir->setToolTip(
ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + 
"blocksdir"));
   465     ui->openDebugLogfileButton->setToolTip(
ui->openDebugLogfileButton->toolTip().arg(tr(
PACKAGE_NAME)));
   475     ui->lineEdit->installEventFilter(
this);
   476     ui->messagesWidget->installEventFilter(
this);
   484     ui->WalletSelector->setVisible(
false);
   485     ui->WalletSelectorLabel->setVisible(
false);
   489     ui->berkeleyDBVersion->setText(DbEnv::version(0, 0, 0));
   491     ui->label_berkeleyDBVersion->hide();
   492     ui->berkeleyDBVersion->hide();
   502     ui->detailWidget->hide();
   503     ui->peerHeading->setText(tr(
"Select a peer to view detailed information."));
   512     settings.setValue(
"RPCConsoleWindowGeometry", saveGeometry());
   520     if(event->type() == QEvent::KeyPress) 
   522         QKeyEvent *keyevt = 
static_cast<QKeyEvent*
>(event);
   523         int key = keyevt->key();
   524         Qt::KeyboardModifiers mod = keyevt->modifiers();
   527         case Qt::Key_Up: 
if(obj == 
ui->lineEdit) { 
browseHistory(-1); 
return true; } 
break;
   528         case Qt::Key_Down: 
if(obj == 
ui->lineEdit) { 
browseHistory(1); 
return true; } 
break;
   530         case Qt::Key_PageDown:
   531             if(obj == 
ui->lineEdit)
   533                 QApplication::postEvent(
ui->messagesWidget, 
new QKeyEvent(*keyevt));
   541                 QApplication::postEvent(
ui->lineEdit, 
new QKeyEvent(*keyevt));
   549             if(obj == 
ui->messagesWidget && (
   550                   (!mod && !keyevt->text().isEmpty() && key != Qt::Key_Tab) ||
   551                   ((mod & Qt::ControlModifier) && key == Qt::Key_V) ||
   552                   ((mod & Qt::ShiftModifier) && key == Qt::Key_Insert)))
   554                 ui->lineEdit->setFocus();
   555                 QApplication::postEvent(
ui->lineEdit, 
new QKeyEvent(*keyevt));
   560     return QWidget::eventFilter(obj, event);
   566     ui->trafficGraph->setClientModel(model);
   586         ui->peerWidget->verticalHeader()->hide();
   587         ui->peerWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
   588         ui->peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
   589         ui->peerWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
   590         ui->peerWidget->setContextMenuPolicy(Qt::CustomContextMenu);
   594         ui->peerWidget->horizontalHeader()->setStretchLastSection(
true);
   597         QAction* disconnectAction = 
new QAction(tr(
"&Disconnect"), 
this);
   598         QAction* banAction1h      = 
new QAction(tr(
"Ban for") + 
" " + tr(
"1 &hour"), 
this);
   599         QAction* banAction24h     = 
new QAction(tr(
"Ban for") + 
" " + tr(
"1 &day"), 
this);
   600         QAction* banAction7d      = 
new QAction(tr(
"Ban for") + 
" " + tr(
"1 &week"), 
this);
   601         QAction* banAction365d    = 
new QAction(tr(
"Ban for") + 
" " + tr(
"1 &year"), 
this);
   614         QSignalMapper* signalMapper = 
new QSignalMapper(
this);
   615         signalMapper->setMapping(banAction1h, 60*60);
   616         signalMapper->setMapping(banAction24h, 60*60*24);
   617         signalMapper->setMapping(banAction7d, 60*60*24*7);
   618         signalMapper->setMapping(banAction365d, 60*60*24*365);
   619         connect(banAction1h, &QAction::triggered, signalMapper, 
static_cast<void (QSignalMapper::*)()
>(&QSignalMapper::map));
   620         connect(banAction24h, &QAction::triggered, signalMapper, 
static_cast<void (QSignalMapper::*)()
>(&QSignalMapper::map));
   621         connect(banAction7d, &QAction::triggered, signalMapper, 
static_cast<void (QSignalMapper::*)()
>(&QSignalMapper::map));
   622         connect(banAction365d, &QAction::triggered, signalMapper, 
static_cast<void (QSignalMapper::*)()
>(&QSignalMapper::map));
   638         ui->banlistWidget->verticalHeader()->hide();
   639         ui->banlistWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
   640         ui->banlistWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
   641         ui->banlistWidget->setSelectionMode(QAbstractItemView::SingleSelection);
   642         ui->banlistWidget->setContextMenuPolicy(Qt::CustomContextMenu);
   645         ui->banlistWidget->horizontalHeader()->setStretchLastSection(
true);
   648         QAction* unbanAction = 
new QAction(tr(
"&Unban"), 
this);
   670         ui->networkName->setText(QString::fromStdString(
Params().NetworkIDString()));
   673         QStringList wordList;
   675         for (
size_t i = 0; i < commandList.size(); ++i)
   677             wordList << commandList[i].c_str();
   678             wordList << (
"help " + commandList[i]).c_str();
   681         wordList << 
"help-console";
   684         autoCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel);
   703     QString display_name = 
name.isEmpty() ? 
"["+tr(
"default wallet")+
"]" : 
name;
   704     ui->WalletSelector->addItem(display_name, 
name);
   705     if (
ui->WalletSelector->count() == 2 && !isVisible()) {
   707         ui->WalletSelector->setCurrentIndex(1);
   709     if (
ui->WalletSelector->count() > 2) {
   710         ui->WalletSelector->setVisible(
true);
   711         ui->WalletSelectorLabel->setVisible(
true);
   718     ui->WalletSelector->removeItem(
ui->WalletSelector->findData(
name));
   719     if (
ui->WalletSelector->count() == 2) {
   720         ui->WalletSelector->setVisible(
false);
   721         ui->WalletSelectorLabel->setVisible(
false);
   726 static QString categoryClass(
int category)
   733     default:                       
return "misc";
   756     QString str = 
ui->messagesWidget->toHtml();
   759     str.replace(QString(
"font-size:%1pt").arg(
consoleFontSize), QString(
"font-size:%1pt").arg(newSize));
   766     float oldPosFactor = 1.0 / 
ui->messagesWidget->verticalScrollBar()->maximum() * 
ui->messagesWidget->verticalScrollBar()->value();
   768     ui->messagesWidget->setHtml(str);
   769     ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * 
ui->messagesWidget->verticalScrollBar()->maximum());
   774     ui->messagesWidget->clear();
   780     ui->lineEdit->clear();
   781     ui->lineEdit->setFocus();
   787         ui->messagesWidget->document()->addResource(
   788                     QTextDocument::ImageResource,
   795     ui->messagesWidget->document()->setDefaultStyleSheet(
   798                 "td.time { color: #808080; font-size: %2; padding-top: 3px; } "   799                 "td.message { font-family: %1; font-size: %2; white-space:pre-wrap; } "   800                 "td.cmd-request { color: #006060; } "   801                 "td.cmd-error { color: red; } "   802                 ".secwarning { color: red; }"   803                 "b { color: #006060; } "   808     QString clsKey = 
"(⌘)-L";
   810     QString clsKey = 
"Ctrl-L";
   814                         tr(
"Use up and down arrows to navigate history, and %1 to clear screen.").arg(
"<b>"+clsKey+
"</b>") + 
"<br>" +
   815                         tr(
"Type %1 for an overview of available commands.").arg(
"<b>help</b>") + 
"<br>" +
   816                         tr(
"For more information on using this console type %1.").arg(
"<b>help-console</b>") +
   817                         "<br><span class=\"secwarning\"><br>" +
   818                         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.") +
   825     if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape)
   833     QTime time = QTime::currentTime();
   834     QString timeString = time.toString();
   836     out += 
"<table><tr><td class=\"time\" width=\"65\">" + timeString + 
"</td>";
   837     out += 
"<td class=\"icon\" width=\"32\"><img src=\"" + categoryClass(category) + 
"\"></td>";
   838     out += 
"<td class=\"message " + categoryClass(category) + 
"\" valign=\"middle\">";
   843     out += 
"</td></tr></table>";
   844     ui->messagesWidget->append(out);
   854         connections += 
" (" + tr(
"Network activity disabled") + 
")";
   857     ui->numberOfConnections->setText(connections);
   876         ui->numberOfBlocks->setText(QString::number(count));
   877         ui->lastBlockTime->setText(blockDate.toString());
   883     ui->mempoolNumberTxs->setText(QString::number(numberOfTxs));
   885     if (dynUsage < 1000000)
   886         ui->mempoolSize->setText(QString::number(dynUsage/1000.0, 
'f', 2) + 
" KB");
   888         ui->mempoolSize->setText(QString::number(dynUsage/1000000.0, 
'f', 2) + 
" MB");
   893     QString cmd = 
ui->lineEdit->text();
   897         std::string strFilteredCmd;
   902                 throw std::runtime_error(
"Invalid command line");
   904         } 
catch (
const std::exception& e) {
   905             QMessageBox::critical(
this, 
"Error", QString(
"Error: ") + QString::fromStdString(e.what()));
   909         ui->lineEdit->clear();
   915         const int wallet_index = 
ui->WalletSelector->currentIndex();
   916         if (wallet_index > 0) {
   917             walletID = (QString)
ui->WalletSelector->itemData(wallet_index).value<QString>();
   921             if (walletID.isNull()) {
   933         cmd = QString::fromStdString(strFilteredCmd);
   968     ui->lineEdit->setText(cmd);
   974     executor->moveToThread(&
thread);
   986     connect(&
thread, &QThread::finished, executor, &RPCExecutor::deleteLater, Qt::DirectConnection);
   995     if (
ui->tabWidget->widget(index) == 
ui->tab_console)
   996         ui->lineEdit->setFocus();
   997     else if (
ui->tabWidget->widget(index) != 
ui->tab_peers)
  1008     QScrollBar *scrollbar = 
ui->messagesWidget->verticalScrollBar();
  1009     scrollbar->setValue(scrollbar->maximum());
  1014     const int multiplier = 5; 
  1015     int mins = value * multiplier;
  1021     ui->trafficGraph->setGraphRangeMins(mins);
  1033     Q_UNUSED(deselected);
  1045     QModelIndexList selected = 
ui->peerWidget->selectionModel()->selectedIndexes();
  1047     for(
int i = 0; i < selected.size(); i++)
  1060     bool fUnselect = 
false;
  1061     bool fReselect = 
false;
  1067     int selectedRow = -1;
  1068     QModelIndexList selectedModelIndex = 
ui->peerWidget->selectionModel()->selectedIndexes();
  1069     if (!selectedModelIndex.isEmpty()) {
  1070         selectedRow = selectedModelIndex.first().row();
  1077     if (detailNodeRow < 0)
  1084         if (detailNodeRow != selectedRow)
  1095     if (fUnselect && selectedRow >= 0) {
  1114     QString peerAddrDetails(QString::fromStdString(stats->
nodeStats.
addrName) + 
" ");
  1115     peerAddrDetails += tr(
"(node id: %1)").arg(QString::number(stats->
nodeStats.
nodeid));
  1117         peerAddrDetails += 
"<br />" + tr(
"via %1").arg(QString::fromStdString(stats->
nodeStats.
addrLocal));
  1118     ui->peerHeading->setText(peerAddrDetails);
  1145             ui->peerSyncHeight->setText(tr(
"Unknown"));
  1151             ui->peerCommonHeight->setText(tr(
"Unknown"));
  1154     ui->detailWidget->show();
  1159     QWidget::resizeEvent(event);
  1164     QWidget::showEvent(event);
  1175     QWidget::hideEvent(event);
  1186     QModelIndex index = 
ui->peerWidget->indexAt(point);
  1187     if (index.isValid())
  1193     QModelIndex index = 
ui->banlistWidget->indexAt(point);
  1194     if (index.isValid())
  1202     for(
int i = 0; i < nodes.count(); i++)
  1205         NodeId id = nodes.at(i).data().toLongLong();
  1219     for(
int i = 0; i < nodes.count(); i++)
  1222         NodeId id = nodes.at(i).data().toLongLong();
  1226         if(detailNodeRow < 0)
  1246     for(
int i = 0; i < nodes.count(); i++)
  1249         QString strNode = nodes.at(i).data().toString();
  1252         LookupSubNet(strNode.toStdString().c_str(), possibleSubnet);
  1262     ui->peerWidget->selectionModel()->clearSelection();
  1264     ui->detailWidget->hide();
  1265     ui->peerHeading->setText(tr(
"Select a peer to view detailed information."));
  1274     ui->banlistWidget->setVisible(visible);
  1275     ui->banHeading->setVisible(visible);
  1280     ui->tabWidget->setCurrentIndex(tabType);
 
QString formatClientStartupTime() const
 
int getRowByNodeId(NodeId nodeid)
 
const char * Name()
Implementation name. 
 
void addWallet(WalletModel *const walletModel)
 
QString formatSubVersion() const
 
Local Bitcoin RPC console. 
 
void keyPressEvent(QKeyEvent *)
 
QString cmdBeforeBrowsing
 
CNodeStateStats nodeStateStats
 
virtual bool getNetworkActive()=0
Get network active. 
 
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()
 
RPCExecutor(interfaces::Node &node)
 
QString blocksDir() const
 
virtual double getVerificationProgress()=0
Get verification progress. 
 
void showPeersTableContextMenu(const QPoint &point)
Show custom context menu on Peers tab. 
 
virtual bool unban(const CSubNet &ip)=0
Unban node. 
 
virtual UniValue executeRpc(const std::string &command, const UniValue ¶ms, const std::string &uri)=0
Execute rpc command. 
 
virtual void rpcUnsetTimerInterface(RPCTimerInterface *iface)=0
Unset RPC timer interface. 
 
virtual int64_t getTotalBytesRecv()=0
Get total bytes recv. 
 
interfaces::Node & m_node
 
void setNetworkActive(bool networkActive)
Set network state shown in the UI. 
 
void scrollToEnd()
Scroll console view to end. 
 
QString formatBytes(uint64_t bytes)
 
QString formatTimeOffset(int64_t nTimeOffset)
 
void networkActiveChanged(bool networkActive)
 
void clearSelectedNode()
clear the selected node 
 
const struct @8 ICON_MAPPING[]
 
RPCConsole(interfaces::Node &node, const PlatformStyle *platformStyle, QWidget *parent)
 
const std::string & get_str() const
 
RPCTimerBase * NewTimer(std::function< void()> &func, int64_t millis)
Factory function for timers. 
 
QString HtmlEscape(const QString &str, bool fMultiLine)
 
PeerTableModel * getPeerTableModel()
 
void disconnectSelectedNode()
Disconnect a selected node on the Peers tab. 
 
void cmdRequest(const QString &command, const QString &walletID)
 
void on_tabWidget_currentChanged(int index)
 
void numConnectionsChanged(int count)
 
void updateNodeDetail(const CNodeCombinedStats *stats)
show detailed information on ui about selected node 
 
virtual void rpcSetTimerInterfaceIfUnset(RPCTimerInterface *iface)=0
Set RPC timer interface if unset. 
 
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)
 
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
 
const PlatformStyle *const platformStyle
 
void reply(int category, const QString &command)
 
QMenu * peersTableContextMenu
 
void browseHistory(int offset)
Go forward or back in history. 
 
bool fNodeStateStatsAvailable
 
bool push_back(const UniValue &val)
 
void message(int category, const QString &msg)
Append the message to the message widget. 
 
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total) 
 
int64_t GetSystemTimeInSeconds()
 
Class for handling RPC timers (used for e.g. 
 
QString formatDurationStr(int secs)
 
const int CONSOLE_HISTORY
 
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible) 
 
BanTableModel * getBanTableModel()
 
interfaces::Node & node() const
 
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
 
void peerLayoutChanged()
Handle updated peer information. 
 
RPCTimerInterface * rpcTimerInterface
 
void updateNetworkState()
Update UI with latest network info from model. 
 
const CNodeCombinedStats * getNodeStats(int idx)
 
void request(const QString &command, const QString &walletID)
 
virtual bool disconnect(NodeId id)=0
Disconnect node. 
 
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, bool header)
 
QString getWalletName() const
 
static bool RPCParseCommandLine(interfaces::Node *node, std::string &strResult, const std::string &strCommand, bool fExecute, std::string *const pstrFilteredOut=nullptr, const std::string *walletID=nullptr)
Split shell command line into a list of arguments and optionally execute the command(s). 
 
void on_openDebugLogfileButton_clicked()
open the debug.log from the current datadir 
 
QtRPCTimerBase(std::function< void()> &_func, int64_t millis)
 
Model for Bitcoin network client. 
 
void unbanSelectedNode()
Unban a selected node on the Bans tab. 
 
void hideEvent(QHideEvent *event)
 
ClientModel * clientModel
 
QString formatPingTime(double dPingTime)
 
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)
 
void showOrHideBanTableIfRequired()
Hides ban table if no bans are present. 
 
virtual bool ban(const CNetAddr &net_addr, BanReason reason, int64_t ban_time_offset)=0
Ban node. 
 
void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut)
update traffic statistics 
 
virtual int64_t getLastBlockTime()=0
Get last block time. 
 
QList< NodeId > cachedNodeids
 
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)
 
std::function< void()> func
 
void setNumConnections(int count)
Set number of connections shown in the UI. 
 
const CChainParams & Params()
Return the currently selected parameters. 
 
interfaces::Node & m_node
 
void peerLayoutAboutToChange()
Handle selection caching before update. 
 
Interface to Bitcoin wallet from Qt view code. 
 
virtual std::vector< std::string > listRpcCommands()=0
List rpc commands. 
 
QString formatServicesStr(quint64 mask)
 
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. 
 
void removeWallet(WalletModel *const walletModel)
 
const int INITIAL_TRAFFIC_GRAPH_MINS
 
const char fontSizeSettingsKey[]
 
void peerSelected(const QItemSelection &selected, const QItemSelection &deselected)
Handle selection of peer in peers list. 
 
void mempoolSizeChanged(long count, size_t mempoolSizeInBytes)
 
const QSize FONT_RANGE(4, 40)
 
static bool RPCExecuteCommandLine(interfaces::Node &node, std::string &strResult, const std::string &strCommand, std::string *const pstrFilteredOut=nullptr, const std::string *walletID=nullptr)
 
virtual int getNumBlocks()=0
Get num blocks. 
 
QCompleter * autoCompleter
 
virtual int64_t getTotalBytesSent()=0
Get total bytes sent. 
 
Top-level interface for a bitcoin node (bsha3d process). 
 
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