7 class AddressTableModel;
8 class TransactionTableModel;
16 /** Model for Bitcoin network client. */
17 class ClientModel : public QObject
21 explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);
24 OptionsModel *getOptionsModel();
26 double getPoSKernelPS();
27 double getDifficulty(bool fProofofStake);
29 int getNumConnections() const;
30 int getNumBlocks() const;
31 int getNumBlocksAtStartup();
33 QDateTime getLastBlockDate() const;
35 //! Return true if client connected to testnet
36 bool isTestNet() const;
37 //! Return true if core is doing initial block download
38 bool inInitialBlockDownload() const;
39 //! Return conservative estimate of total number of blocks, or 0 if unknown
40 int getNumBlocksOfPeers() const;
41 //! Return warnings to be displayed in status bar
42 QString getStatusBarWarnings() const;
44 QString formatFullVersion() const;
45 QString formatBuildDate() const;
46 QString clientName() const;
47 QString formatClientStartupTime() const;
50 OptionsModel *optionsModel;
53 int cachedNumBlocksOfPeers;
55 int numBlocksAtStartup;
59 void subscribeToCoreSignals();
60 void unsubscribeFromCoreSignals();
62 void numConnectionsChanged(int count);
63 void numBlocksChanged(int count, int countOfPeers);
65 //! Asynchronous error notification
66 void error(const QString &title, const QString &message, bool modal);
70 void updateNumConnections(int numConnections);
71 void updateAlert(const QString &hash, int status);
74 #endif // CLIENTMODEL_H