16 #include <validation.h> 31 static int64_t nLastHeaderTipUpdateNotification = 0;
32 static int64_t nLastBlockTipUpdateNotification = 0;
36 optionsModel(_optionsModel),
69 return g_connman->GetNodeCount(connections);
217 nGasPrice = (minGasPrice>DEFAULT_GAS_PRICE)?minGasPrice:DEFAULT_GAS_PRICE;
266 static void ShowProgress(
ClientModel *clientmodel,
const std::string &title,
int nProgress)
269 QMetaObject::invokeMethod(clientmodel,
"showProgress", Qt::QueuedConnection,
270 Q_ARG(QString, QString::fromStdString(title)),
271 Q_ARG(
int, nProgress));
274 static void NotifyNumConnectionsChanged(
ClientModel *clientmodel,
int newNumConnections)
277 QMetaObject::invokeMethod(clientmodel,
"updateNumConnections", Qt::QueuedConnection,
278 Q_ARG(
int, newNumConnections));
281 static void NotifyNetworkActiveChanged(
ClientModel *clientmodel,
bool networkActive)
283 QMetaObject::invokeMethod(clientmodel,
"updateNetworkActive", Qt::QueuedConnection,
284 Q_ARG(
bool, networkActive));
287 static void NotifyAlertChanged(
ClientModel *clientmodel)
289 qDebug() <<
"NotifyAlertChanged";
290 QMetaObject::invokeMethod(clientmodel,
"updateAlert", Qt::QueuedConnection);
293 static void BannedListChanged(
ClientModel *clientmodel)
295 qDebug() << QString(
"%1: Requesting update for peer banlist").arg(__func__);
296 QMetaObject::invokeMethod(clientmodel,
"updateBanlist", Qt::QueuedConnection);
299 static void BlockTipChanged(
ClientModel *clientmodel,
bool initialSync,
const CBlockIndex *pIndex,
bool fHeader)
305 bool batchMode = secs >= 90*60 ?
true :
false;
308 initialSync |= batchMode;
323 int64_t& nLastUpdateNotification = fHeader ? nLastHeaderTipUpdateNotification : nLastBlockTipUpdateNotification;
331 if (!initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
333 QMetaObject::invokeMethod(clientmodel,
"numBlocksChanged", Qt::QueuedConnection,
335 Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->
GetBlockTime())),
337 Q_ARG(
bool, fHeader));
340 QMetaObject::invokeMethod(clientmodel,
"tipChanged", Qt::QueuedConnection);
342 nLastUpdateNotification = now;
PeerTableModel * peerTableModel
void updateNetworkActive(bool networkActive)
std::atomic< int64_t > cachedBestHeaderTime
double getVerificationProgress(const CBlockIndex *tip) const
quint64 getTotalBytesRecv() const
int64_t GetStartupTime()
Server/client environment: argument handling, config file parsing, logging, thread wrappers...
bool getNetworkActive() const
Return true if network activity in core is enabled.
boost::signals2::signal< void(bool networkActive)> NotifyNetworkActiveChanged
Network activity state changed.
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
void networkActiveChanged(bool networkActive)
BanTableModel * banTableModel
OptionsModel * getOptionsModel()
size_t DynamicMemoryUsage() const
std::atomic< int > cachedBestHeaderHeight
QString formatClientStartupTime() const
PeerTableModel * getPeerTableModel()
size_t getMempoolDynamicUsage() const
Return the dynamic memory usage of the mempool.
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
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.
bool isReleaseVersion() const
void alertsChanged(const QString &warnings)
boost::signals2::signal< void(void)> BannedListChanged
Banlist did change.
int64_t CAmount
Amount in lius (Can be negative)
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
bool fBatchProcessingMode
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.
bool inInitialBlockDownload() const
Return true if core is doing initial block download.
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
int Height() const
Return the maximal height in the chain.
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...
QDateTime getLastBlockDate() const
uint64_t getBlockGasLimit(unsigned int blockHeight)
#define CLIENT_VERSION_IS_RELEASE
void unsubscribeFromCoreSignals()
QString formatSubVersion() const
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Show progress e.g.
BanTableModel * getBanTableModel()
bool IsInitialBlockDownload()
Check whether we are doing an initial block download (synchronizing from disk or network) ...
void subscribeToCoreSignals()
std::string GetWarnings(const std::string &strFor)
Format a string that describes several potential problems detected by the core.
int getHeaderTipHeight() const
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 Fabcoin network client.
std::string FormatFullVersion()
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
quint64 getTotalBytesSent() const
ClientModel(OptionsModel *optionsModel, QObject *parent=0)
Interface from Qt to configuration data structure for Fabcoin 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...
int64_t getHeaderTipTime() const
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.
int64_t GetTime()
GetTimeMicros() and GetTimeMillis() both return the system time, but in different units...
CClientUIInterface uiInterface
int nHeight
height of the entry in the chain. The genesis block has height 0
void updateNumConnections(int numConnections)
int64_t GetBlockTime() const
QString boostPathToQString(const fs::path &path)
long getMempoolSize() const
Return number of transactions in the mempool.
QString formatFullVersion() const
enum BlockSource getBlockSource() const
Returns enum BlockSource of the current importing/syncing state.
std::unique_ptr< FascState > globalState
Global state.
void getGasInfo(uint64_t &blockGasLimit, uint64_t &minGasPrice, uint64_t &nGasPrice) const
Get the information about the needed gas.