17 #include "validation.h" 31 static int64_t nLastHeaderTipUpdateNotification = 0;
32 static int64_t nLastBlockTipUpdateNotification = 0;
36 optionsModel(_optionsModel),
69 return g_connman->GetNodeCount(connections);
256 static void ShowProgress(
ClientModel *clientmodel,
const std::string &title,
int nProgress)
259 QMetaObject::invokeMethod(clientmodel,
"showProgress", Qt::QueuedConnection,
260 Q_ARG(QString, QString::fromStdString(title)),
261 Q_ARG(
int, nProgress));
264 static void NotifyNumConnectionsChanged(
ClientModel *clientmodel,
int newNumConnections)
267 QMetaObject::invokeMethod(clientmodel,
"updateNumConnections", Qt::QueuedConnection,
268 Q_ARG(
int, newNumConnections));
271 static void NotifyNetworkActiveChanged(
ClientModel *clientmodel,
bool networkActive)
273 QMetaObject::invokeMethod(clientmodel,
"updateNetworkActive", Qt::QueuedConnection,
274 Q_ARG(
bool, networkActive));
277 static void NotifyAlertChanged(
ClientModel *clientmodel)
279 qDebug() <<
"NotifyAlertChanged";
280 QMetaObject::invokeMethod(clientmodel,
"updateAlert", Qt::QueuedConnection);
283 static void BannedListChanged(
ClientModel *clientmodel)
285 qDebug() << QString(
"%1: Requesting update for peer banlist").arg(__func__);
286 QMetaObject::invokeMethod(clientmodel,
"updateBanlist", Qt::QueuedConnection);
289 static void BlockTipChanged(
ClientModel *clientmodel,
bool initialSync,
const CBlockIndex *pIndex,
bool fHeader)
298 int64_t& nLastUpdateNotification = fHeader ? nLastHeaderTipUpdateNotification : nLastBlockTipUpdateNotification;
306 if (!initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
308 QMetaObject::invokeMethod(clientmodel,
"numBlocksChanged", Qt::QueuedConnection,
310 Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->
GetBlockTime())),
312 Q_ARG(
bool, fHeader));
313 nLastUpdateNotification = now;
QString formatClientStartupTime() const
PeerTableModel * peerTableModel
void updateNetworkActive(bool networkActive)
bool inInitialBlockDownload() const
Return true if core is doing initial block download.
QString formatSubVersion() const
long getMempoolSize() const
Return number of transactions in the mempool.
bool getNetworkActive() const
Return true if network activity in core is enabled.
bool isReleaseVersion() const
int64_t GetBlockTime() const
std::atomic< int64_t > cachedBestHeaderTime
size_t DynamicMemoryUsage() const
int64_t GetStartupTime()
Server/client environment: argument handling, config file parsing, logging, thread wrappers...
boost::signals2::signal< void(bool networkActive)> NotifyNetworkActiveChanged
Network activity state changed.
int Height() const
Return the maximal height in the chain.
CCriticalSection cs_main
Global state.
void networkActiveChanged(bool networkActive)
BanTableModel * banTableModel
OptionsModel * getOptionsModel()
quint64 getTotalBytesSent() const
std::atomic< int > cachedBestHeaderHeight
PeerTableModel * getPeerTableModel()
std::string GetWarnings(const std::string &strFor)
Format a string that describes several potential problems detected by the core.
void numConnectionsChanged(int count)
double GuessVerificationProgress(const ChainTxData &data, CBlockIndex *pindex)
Guess how far we are in the verification process at the given block index.
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
void alertsChanged(const QString &warnings)
boost::signals2::signal< void(void)> BannedListChanged
Banlist did change.
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
boost::signals2::signal< void(bool, const CBlockIndex *)> NotifyBlockTip
New block has been accepted.
boost::signals2::signal< void(bool, const CBlockIndex *)> NotifyHeaderTip
Best header has changed.
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
double getVerificationProgress(const CBlockIndex *tip) const
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
CBlockIndex * pindexBestHeader
Best header we've seen so far (used for getheaders queries' starting points).
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call...
quint64 getTotalBytesRecv() const
void unsubscribeFromCoreSignals()
BanTableModel * getBanTableModel()
bool IsInitialBlockDownload()
Check whether we are doing an initial block download (synchronizing from disk or network) ...
void subscribeToCoreSignals()
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
std::atomic_bool fImporting
std::string strSubVersion
Subversion as sent to the P2P network in version messages.
Model for Raven network client.
size_t getMempoolDynamicUsage() const
Return the dynamic memory usage of the mempool.
std::string FormatFullVersion()
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
QDateTime getLastBlockDate() const
std::atomic_bool fReindex
ClientModel(OptionsModel *optionsModel, QObject *parent=0)
Interface from Qt to configuration data structure for Raven client.
The block chain is a tree shaped structure starting with the genesis block at the root...
const CChainParams & Params()
Return the currently selected parameters.
boost::signals2::signal< void()> NotifyAlertChanged
Status bar alerts changed.
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call...
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
#define CLIENT_VERSION_IS_RELEASE
std::unique_ptr< CConnman > g_connman
OptionsModel * optionsModel
void mempoolSizeChanged(long count, size_t mempoolSizeInBytes)
const fs::path & GetDataDir(bool fNetSpecific)
void setNetworkActive(bool active)
Toggle network activity state in core.
CClientUIInterface uiInterface
int nHeight
height of the entry in the chain. The genesis block has height 0
void updateNumConnections(int numConnections)
int getHeaderTipHeight() const
QString boostPathToQString(const fs::path &path)
boost::signals2::signal< void(const std::string &title, int nProgress, bool resume_possible)> ShowProgress
Show progress e.g.
int64_t getHeaderTipTime() const
QString formatFullVersion() const