16 #include "validation.h" 39 optionsModel(optionsModel),
41 cachedMasternodeCountString(
""),
78 return g_connman->GetNodeCount(connections);
85 return tr(
"Total: %1 (PS compatible: %2 / Enabled: %3)")
207 hash_256.
SetHex(hash.toStdString());
297 return QString::fromStdString(
GetDataDir().
string());
309 QMetaObject::invokeMethod(clientmodel,
"showProgress", Qt::QueuedConnection,
310 Q_ARG(QString, QString::fromStdString(title)),
311 Q_ARG(
int, nProgress));
317 QMetaObject::invokeMethod(clientmodel,
"updateNumConnections", Qt::QueuedConnection,
318 Q_ARG(
int, newNumConnections));
323 QMetaObject::invokeMethod(clientmodel,
"updateNetworkActive", Qt::QueuedConnection,
324 Q_ARG(
bool, networkActive));
329 qDebug() <<
"NotifyAlertChanged: " + QString::fromStdString(hash.
GetHex()) +
" status=" + QString::number(status);
330 QMetaObject::invokeMethod(clientmodel,
"updateAlert", Qt::QueuedConnection,
331 Q_ARG(QString, QString::fromStdString(hash.
GetHex())),
337 qDebug() << QString(
"%1: Requesting update for peer banlist").arg(__func__);
338 QMetaObject::invokeMethod(clientmodel,
"updateBanlist", Qt::QueuedConnection);
360 QMetaObject::invokeMethod(clientmodel,
"numBlocksChanged", Qt::QueuedConnection,
362 Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->
GetBlockTime())),
364 Q_ARG(
bool, fHeader));
365 nLastUpdateNotification = now;
371 QMetaObject::invokeMethod(clientmodel,
"additionalDataSyncProgressChanged", Qt::QueuedConnection,
372 Q_ARG(
double, nSyncProgress));
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
void subscribeToCoreSignals()
ClientModel(OptionsModel *optionsModel, QObject *parent=0)
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
static const int64_t nClientStartupTime
void mempoolSizeChanged(long count, size_t mempoolSizeInBytes)
size_t getMempoolDynamicUsage() const
Return the dynamic memory usage of the mempool.
boost::signals2::signal< void(const uint256 &hash, ChangeType status)> NotifyAlertChanged
bool inInitialBlockDownload() const
Return true if core is doing initial block download.
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
boost::signals2::signal< void(void)> BannedListChanged
static void ShowProgress(ClientModel *clientmodel, const std::string &title, int nProgress)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
int64_t getHeaderTipTime() const
void updateAlert(const QString &hash, int status)
boost::signals2::signal< void(bool, const CBlockIndex *)> NotifyBlockTip
QString cachedMasternodeCountString
void updateNumConnections(int numConnections)
boost::signals2::signal< void(bool, const CBlockIndex *)> NotifyHeaderTip
void setNetworkActive(bool active)
Toggle network activity state in core.
static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, const CBlockIndex *pIndex, bool fHeader)
static void NotifyAdditionalDataSyncProgressChanged(ClientModel *clientmodel, double nSyncProgress)
std::atomic< int64_t > cachedBestHeaderTime
bool isReleaseVersion() const
#define CLIENT_VERSION_IS_RELEASE
Set to true for release, false for prerelease or test build.
static int64_t nLastHeaderTipUpdateNotification
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
void strMasternodesChanged(const QString &strMasternodes)
BanTableModel * banTableModel
CBlockIndex * pindexBestHeader
QString getMasternodeCountString() const
void updateNetworkActive(bool networkActive)
size_t DynamicMemoryUsage() const
CClientUIInterface uiInterface
PeerTableModel * peerTableModel
bool IsInitialBlockDownload()
QString formatSubVersion() const
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
static CAlert getAlertByHash(const uint256 &hash)
OptionsModel * optionsModel
static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, ChangeType status)
const std::string CLIENT_NAME
std::string strSubVersion
int size()
Return the number of (unique) Masternodes.
int getHeaderTipHeight() const
double GuessVerificationProgress(const CCheckpointData &data, CBlockIndex *pindex, bool fSigchecks)
Guess how far we are in the verification process at the given block index.
std::string FormatFullVersion()
static const int MODEL_UPDATE_DELAY
long getMempoolSize() const
Return number of transactions in the mempool.
QString formatFullVersion() const
static void BannedListChanged(ClientModel *clientmodel)
QString formatClientStartupTime() const
bool getNetworkActive() const
Return true if network activity in core is enabled.
quint64 getTotalBytesRecv() const
int CountEnabled(int nProtocolVersion=-1)
std::string GetWarnings(const std::string &strFor)
const CChainParams & Params()
static int64_t nLastBlockTipUpdateNotification
static const int MIN_PRIVATESEND_PEER_PROTO_VERSION
minimum peer version accepted by mixing pool
static void NotifyNetworkActiveChanged(ClientModel *clientmodel, bool networkActive)
std::string GetHex() const
std::unique_ptr< CConnman > g_connman
CBlockIndex * Tip() const
double getVerificationProgress(const CBlockIndex *tip) const
void alertsChanged(const QString &warnings)
int64_t GetBlockTime() const
int64_t GetTime()
For unit testing.
std::atomic< int > cachedBestHeaderHeight
void unsubscribeFromCoreSignals()
boost::signals2::signal< void(double nSyncProgress)> NotifyAdditionalDataSyncProgressChanged
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
void SetHex(const char *psz)
quint64 getTotalBytesSent() const
int nHeight
height of the entry in the chain. The genesis block has height 0
static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConnections)
boost::signals2::signal< void(bool networkActive)> NotifyNetworkActiveChanged
void numConnectionsChanged(int count)
QDateTime getLastBlockDate() const
QString clientName() const
OptionsModel * getOptionsModel()
BanTableModel * getBanTableModel()
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
void networkActiveChanged(bool networkActive)
PeerTableModel * getPeerTableModel()