18 #include <validation.h> 31 static int64_t nLastHeaderTipUpdateNotification = 0;
32 static int64_t nLastBlockTipUpdateNotification = 0;
37 optionsModel(_optionsModel),
191 static void ShowProgress(
ClientModel *clientmodel,
const std::string &title,
int nProgress)
194 QMetaObject::invokeMethod(clientmodel,
"showProgress", Qt::QueuedConnection,
195 Q_ARG(QString, QString::fromStdString(title)),
196 Q_ARG(
int, nProgress));
199 static void NotifyNumConnectionsChanged(
ClientModel *clientmodel,
int newNumConnections)
202 QMetaObject::invokeMethod(clientmodel,
"updateNumConnections", Qt::QueuedConnection,
203 Q_ARG(
int, newNumConnections));
206 static void NotifyNetworkActiveChanged(
ClientModel *clientmodel,
bool networkActive)
208 QMetaObject::invokeMethod(clientmodel,
"updateNetworkActive", Qt::QueuedConnection,
209 Q_ARG(
bool, networkActive));
212 static void NotifyAlertChanged(
ClientModel *clientmodel)
214 qDebug() <<
"NotifyAlertChanged";
215 QMetaObject::invokeMethod(clientmodel,
"updateAlert", Qt::QueuedConnection);
218 static void BannedListChanged(
ClientModel *clientmodel)
220 qDebug() << QString(
"%1: Requesting update for peer banlist").arg(__func__);
221 QMetaObject::invokeMethod(clientmodel,
"updateBanlist", Qt::QueuedConnection);
224 static void BlockTipChanged(
ClientModel *clientmodel,
bool initialSync,
int height, int64_t blockTime,
double verificationProgress,
bool fHeader)
233 int64_t& nLastUpdateNotification = fHeader ? nLastHeaderTipUpdateNotification : nLastBlockTipUpdateNotification;
241 if (!initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
243 QMetaObject::invokeMethod(clientmodel,
"numBlocksChanged", Qt::QueuedConnection,
245 Q_ARG(QDateTime, QDateTime::fromTime_t(blockTime)),
246 Q_ARG(
double, verificationProgress),
247 Q_ARG(
bool, fHeader));
248 nLastUpdateNotification = now;
virtual std::unique_ptr< Handler > handleNotifyHeaderTip(NotifyHeaderTipFn fn)=0
QString formatClientStartupTime() const
PeerTableModel * peerTableModel
void updateNetworkActive(bool networkActive)
QString formatSubVersion() const
virtual std::string getWarnings(const std::string &type)=0
Get warnings.
interfaces::Node & m_node
bool isReleaseVersion() const
std::atomic< int64_t > cachedBestHeaderTime
QString blocksDir() const
virtual size_t getMempoolDynamicUsage()=0
Get mempool dynamic usage.
virtual bool getProxy(Network net, proxyType &proxy_info)=0
Get proxy.
int64_t GetStartupTime()
Server/client environment: argument handling, config file parsing, thread wrappers, startup time.
virtual int64_t getTotalBytesRecv()=0
Get total bytes recv.
virtual bool getImporting()=0
Get importing.
virtual size_t getMempoolSize()=0
Get mempool size.
void networkActiveChanged(bool networkActive)
BanTableModel * banTableModel
std::unique_ptr< interfaces::Handler > m_handler_show_progress
OptionsModel * getOptionsModel()
std::atomic< int > cachedBestHeaderHeight
PeerTableModel * getPeerTableModel()
virtual std::unique_ptr< Handler > handleNotifyBlockTip(NotifyBlockTipFn fn)=0
void numConnectionsChanged(int count)
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
void alertsChanged(const QString &warnings)
std::unique_ptr< interfaces::Handler > m_handler_notify_block_tip
virtual std::unique_ptr< Handler > handleNotifyNumConnectionsChanged(NotifyNumConnectionsChangedFn fn)=0
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
#define CLIENT_VERSION_IS_RELEASE
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call...
void unsubscribeFromCoreSignals()
virtual std::unique_ptr< Handler > handleShowProgress(ShowProgressFn fn)=0
BanTableModel * getBanTableModel()
void subscribeToCoreSignals()
std::unique_ptr< interfaces::Handler > m_handler_banned_list_changed
ClientModel(interfaces::Node &node, OptionsModel *optionsModel, QObject *parent=0)
virtual std::unique_ptr< Handler > handleBannedListChanged(BannedListChangedFn fn)=0
std::string strSubVersion
Subversion as sent to the P2P network in version messages.
Model for Bitcoin network client.
std::unique_ptr< interfaces::Handler > m_handler_notify_header_tip
std::string FormatFullVersion()
const fs::path & GetBlocksDir(bool fNetSpecific)
virtual bool getReindex()=0
Get reindex.
std::unique_ptr< interfaces::Handler > m_handler_notify_num_connections_changed
Interface from Qt to configuration data structure for Bitcoin client.
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call...
std::string ToStringIPPort() const
virtual bool getHeaderTip(int &height, int64_t &block_time)=0
Get header tip height and time.
OptionsModel * optionsModel
void mempoolSizeChanged(long count, size_t mempoolSizeInBytes)
const fs::path & GetDataDir(bool fNetSpecific)
virtual std::unique_ptr< Handler > handleNotifyAlertChanged(NotifyAlertChangedFn fn)=0
std::unique_ptr< interfaces::Handler > m_handler_notify_network_active_changed
void updateNumConnections(int numConnections)
int getHeaderTipHeight() const
QString boostPathToQString(const fs::path &path)
std::unique_ptr< interfaces::Handler > m_handler_notify_alert_changed
virtual std::unique_ptr< Handler > handleNotifyNetworkActiveChanged(NotifyNetworkActiveChangedFn fn)=0
virtual int64_t getTotalBytesSent()=0
Get total bytes sent.
int64_t getHeaderTipTime() const
Top-level interface for a bitcoin node (bsha3d process).
virtual size_t getNodeCount(CConnman::NumConnections flags)=0
Get number of connections.
QString formatFullVersion() const
bool getProxyInfo(std::string &ip_port) const