Changeset View
Changeset View
Standalone View
Standalone View
src/qt/clientmodel.h
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_QT_CLIENTMODEL_H | #ifndef BITCOIN_QT_CLIENTMODEL_H | ||||
#define BITCOIN_QT_CLIENTMODEL_H | #define BITCOIN_QT_CLIENTMODEL_H | ||||
#include <QDateTime> | #include <QDateTime> | ||||
#include <QObject> | #include <QObject> | ||||
#include <atomic> | #include <atomic> | ||||
#include <memory> | #include <memory> | ||||
#include <primitives/blockhash.h> | |||||
#include <sync.h> | |||||
class BanTableModel; | class BanTableModel; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class OptionsModel; | class OptionsModel; | ||||
class PeerTableModel; | class PeerTableModel; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
enum class SynchronizationState; | enum class SynchronizationState; | ||||
Show All 28 Lines | public: | ||||
interfaces::Node &node() const { return m_node; } | interfaces::Node &node() const { return m_node; } | ||||
OptionsModel *getOptionsModel(); | OptionsModel *getOptionsModel(); | ||||
PeerTableModel *getPeerTableModel(); | PeerTableModel *getPeerTableModel(); | ||||
BanTableModel *getBanTableModel(); | BanTableModel *getBanTableModel(); | ||||
//! Return number of connections, default is in- and outbound (total) | //! Return number of connections, default is in- and outbound (total) | ||||
int getNumConnections(NumConnections flags = CONNECTIONS_ALL) const; | int getNumConnections(NumConnections flags = CONNECTIONS_ALL) const; | ||||
int getNumBlocks() const; | int getNumBlocks() const; | ||||
BlockHash getBestBlockHash(); | |||||
int getHeaderTipHeight() const; | int getHeaderTipHeight() const; | ||||
int64_t getHeaderTipTime() const; | int64_t getHeaderTipTime() const; | ||||
//! Returns enum BlockSource of the current importing/syncing state | //! Returns enum BlockSource of the current importing/syncing state | ||||
enum BlockSource getBlockSource() const; | enum BlockSource getBlockSource() const; | ||||
//! Return warnings to be displayed in status bar | //! Return warnings to be displayed in status bar | ||||
QString getStatusBarWarnings() const; | QString getStatusBarWarnings() const; | ||||
QString formatFullVersion() const; | QString formatFullVersion() const; | ||||
QString formatSubVersion() const; | QString formatSubVersion() const; | ||||
bool isReleaseVersion() const; | bool isReleaseVersion() const; | ||||
QString formatClientStartupTime() const; | QString formatClientStartupTime() const; | ||||
QString dataDir() const; | QString dataDir() const; | ||||
QString blocksDir() const; | QString blocksDir() const; | ||||
bool getProxyInfo(std::string &ip_port) const; | bool getProxyInfo(std::string &ip_port) const; | ||||
// caches for the best header, number of blocks | // caches for the best header, number of blocks | ||||
mutable std::atomic<int> cachedBestHeaderHeight; | mutable std::atomic<int> cachedBestHeaderHeight; | ||||
mutable std::atomic<int64_t> cachedBestHeaderTime; | mutable std::atomic<int64_t> cachedBestHeaderTime; | ||||
mutable std::atomic<int> m_cached_num_blocks{-1}; | mutable std::atomic<int> m_cached_num_blocks{-1}; | ||||
Mutex m_cached_tip_mutex; | |||||
BlockHash m_cached_tip_blocks GUARDED_BY(m_cached_tip_mutex){}; | |||||
private: | private: | ||||
interfaces::Node &m_node; | interfaces::Node &m_node; | ||||
std::unique_ptr<interfaces::Handler> m_handler_show_progress; | std::unique_ptr<interfaces::Handler> m_handler_show_progress; | ||||
std::unique_ptr<interfaces::Handler> | std::unique_ptr<interfaces::Handler> | ||||
m_handler_notify_num_connections_changed; | m_handler_notify_num_connections_changed; | ||||
std::unique_ptr<interfaces::Handler> | std::unique_ptr<interfaces::Handler> | ||||
m_handler_notify_network_active_changed; | m_handler_notify_network_active_changed; | ||||
std::unique_ptr<interfaces::Handler> m_handler_notify_alert_changed; | std::unique_ptr<interfaces::Handler> m_handler_notify_alert_changed; | ||||
Show All 38 Lines |