Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Model for Dash network client. More...
#include <clientmodel.h>
Public Slots | |
void | updateTimer () |
void | updateNumConnections (int numConnections) |
void | updateNetworkActive (bool networkActive) |
void | updateAlert () |
void | updateBanlist () |
Signals | |
void | numConnectionsChanged (int count) |
void | masternodeListChanged () const |
void | numBlocksChanged (int count, const QDateTime &blockDate, const QString &blockHash, double nVerificationProgress, bool header) |
void | additionalDataSyncProgressChanged (double nSyncProgress) |
void | mempoolSizeChanged (long count, size_t mempoolSizeInBytes) |
void | islockCountChanged (size_t count) |
void | networkActiveChanged (bool networkActive) |
void | alertsChanged (const QString &warnings) |
void | message (const QString &title, const QString &message, unsigned int style) |
Fired when a message should be reported to the user. More... | |
void | showProgress (const QString &title, int nProgress) |
Public Member Functions | |
ClientModel (OptionsModel *optionsModel, QObject *parent=0) | |
~ClientModel () | |
OptionsModel * | getOptionsModel () |
PeerTableModel * | getPeerTableModel () |
BanTableModel * | getBanTableModel () |
int | getNumConnections (unsigned int flags=CONNECTIONS_ALL) const |
Return number of connections, default is in- and outbound (total) More... | |
int | getNumBlocks () const |
int | getHeaderTipHeight () const |
int64_t | getHeaderTipTime () const |
long | getMempoolSize () const |
Return number of transactions in the mempool. More... | |
size_t | getMempoolDynamicUsage () const |
Return the dynamic memory usage of the mempool. More... | |
size_t | getInstantSentLockCount () const |
Return number of ISLOCKs. More... | |
void | setMasternodeList (const CDeterministicMNList &mnList) |
CDeterministicMNList | getMasternodeList () const |
void | refreshMasternodeList () |
quint64 | getTotalBytesRecv () const |
quint64 | getTotalBytesSent () const |
double | getVerificationProgress (const CBlockIndex *tip) const |
QDateTime | getLastBlockDate () const |
QString | getLastBlockHash () const |
bool | inInitialBlockDownload () const |
Return true if core is doing initial block download. More... | |
enum BlockSource | getBlockSource () const |
Returns enum BlockSource of the current importing/syncing state. More... | |
bool | getNetworkActive () const |
Return true if network activity in core is enabled. More... | |
void | setNetworkActive (bool active) |
Toggle network activity state in core. More... | |
QString | getStatusBarWarnings () const |
Return warnings to be displayed in status bar. More... | |
QString | formatFullVersion () const |
QString | formatSubVersion () const |
bool | isReleaseVersion () const |
QString | formatClientStartupTime () const |
QString | dataDir () const |
Public Attributes | |
std::atomic< int > | cachedBestHeaderHeight |
std::atomic< int64_t > | cachedBestHeaderTime |
Private Member Functions | |
void | subscribeToCoreSignals () |
void | unsubscribeFromCoreSignals () |
Private Attributes | |
OptionsModel * | optionsModel |
PeerTableModel * | peerTableModel |
BanTableModel * | banTableModel |
QTimer * | pollTimer |
CCriticalSection | cs_mnlinst |
CDeterministicMNList | mnListCached |
Detailed Description
Model for Dash network client.
Definition at line 42 of file clientmodel.h.
Constructor & Destructor Documentation
◆ ClientModel()
|
explicit |
Definition at line 39 of file clientmodel.cpp.
References banTableModel, cachedBestHeaderHeight, cachedBestHeaderTime, MODEL_UPDATE_DELAY, peerTableModel, pollTimer, subscribeToCoreSignals(), and updateTimer().
◆ ~ClientModel()
ClientModel::~ClientModel | ( | ) |
Definition at line 57 of file clientmodel.cpp.
References unsubscribeFromCoreSignals().
Member Function Documentation
◆ additionalDataSyncProgressChanged
|
signal |
◆ alertsChanged
|
signal |
Referenced by updateAlert().
◆ dataDir()
QString ClientModel::dataDir | ( | ) | const |
Definition at line 290 of file clientmodel.cpp.
References GUIUtil::boostPathToQString(), and GetDataDir().
Referenced by RPCConsole::setClientModel().
◆ formatClientStartupTime()
QString ClientModel::formatClientStartupTime | ( | ) | const |
Definition at line 285 of file clientmodel.cpp.
References GetStartupTime().
Referenced by RPCConsole::setClientModel().
◆ formatFullVersion()
QString ClientModel::formatFullVersion | ( | ) | const |
Definition at line 270 of file clientmodel.cpp.
References FormatFullVersion().
Referenced by RPCConsole::setClientModel().
◆ formatSubVersion()
QString ClientModel::formatSubVersion | ( | ) | const |
Definition at line 275 of file clientmodel.cpp.
References strSubVersion.
Referenced by RPCConsole::setClientModel().
◆ getBanTableModel()
BanTableModel * ClientModel::getBanTableModel | ( | ) |
Definition at line 265 of file clientmodel.cpp.
References banTableModel.
Referenced by RPCConsole::banSelectedNode(), RPCConsole::setClientModel(), RPCConsole::showOrHideBanTableIfRequired(), and RPCConsole::unbanSelectedNode().
◆ getBlockSource()
enum BlockSource ClientModel::getBlockSource | ( | ) | const |
Returns enum BlockSource of the current importing/syncing state.
Definition at line 223 of file clientmodel.cpp.
References BLOCK_SOURCE_DISK, BLOCK_SOURCE_NETWORK, BLOCK_SOURCE_NONE, BLOCK_SOURCE_REINDEX, fImporting, fReindex, and getNumConnections().
Referenced by BitcoinGUI::setNumBlocks().
◆ getHeaderTipHeight()
int ClientModel::getHeaderTipHeight | ( | ) | const |
Definition at line 106 of file clientmodel.cpp.
References cachedBestHeaderHeight, cachedBestHeaderTime, cs_main, CBlockIndex::GetBlockTime(), LOCK, CBlockIndex::nHeight, and pindexBestHeader.
Referenced by BitcoinGUI::setClientModel(), and BitcoinGUI::updateHeadersSyncProgressLabel().
◆ getHeaderTipTime()
int64_t ClientModel::getHeaderTipTime | ( | ) | const |
Definition at line 120 of file clientmodel.cpp.
References cachedBestHeaderHeight, cachedBestHeaderTime, cs_main, CBlockIndex::GetBlockTime(), LOCK, CBlockIndex::nHeight, and pindexBestHeader.
Referenced by BitcoinGUI::setClientModel(), and BitcoinGUI::updateHeadersSyncProgressLabel().
◆ getInstantSentLockCount()
size_t ClientModel::getInstantSentLockCount | ( | ) | const |
Return number of ISLOCKs.
Definition at line 176 of file clientmodel.cpp.
References llmq::CInstantSendManager::GetInstantSendLockCount(), and llmq::quorumInstantSendManager.
Referenced by updateTimer().
◆ getLastBlockDate()
QDateTime ClientModel::getLastBlockDate | ( | ) | const |
Definition at line 146 of file clientmodel.cpp.
References chainActive, cs_main, CBlockIndex::GetBlockTime(), LOCK, Params(), and CChain::Tip().
Referenced by BitcoinGUI::setAdditionalDataSyncProgress(), RPCConsole::setClientModel(), BitcoinGUI::setClientModel(), and BitcoinGUI::updateNetworkState().
◆ getLastBlockHash()
QString ClientModel::getLastBlockHash | ( | ) | const |
Definition at line 156 of file clientmodel.cpp.
References chainActive, cs_main, CBlockIndex::GetBlockHash(), LOCK, Params(), CChain::Tip(), base_blob< BITS >::ToString(), and CBlockIndex::ToString().
Referenced by BitcoinGUI::setAdditionalDataSyncProgress(), RPCConsole::setClientModel(), BitcoinGUI::setClientModel(), and BitcoinGUI::updateNetworkState().
◆ getMasternodeList()
CDeterministicMNList ClientModel::getMasternodeList | ( | ) | const |
Definition at line 88 of file clientmodel.cpp.
References cs_mnlinst, LOCK, and mnListCached.
Referenced by MasternodeList::GetSelectedDIP3MN(), MasternodeList::updateDIP3List(), and RPCConsole::updateMasternodeCount().
◆ getMempoolDynamicUsage()
size_t ClientModel::getMempoolDynamicUsage | ( | ) | const |
Return the dynamic memory usage of the mempool.
Definition at line 171 of file clientmodel.cpp.
References CTxMemPool::DynamicMemoryUsage(), and mempool.
Referenced by updateTimer().
◆ getMempoolSize()
long ClientModel::getMempoolSize | ( | ) | const |
Return number of transactions in the mempool.
Definition at line 166 of file clientmodel.cpp.
References mempool, and CTxMemPool::size().
Referenced by updateTimer().
◆ getNetworkActive()
bool ClientModel::getNetworkActive | ( | ) | const |
Return true if network activity in core is enabled.
Definition at line 242 of file clientmodel.cpp.
References g_connman.
Referenced by BitcoinGUI::toggleNetworkActive(), RPCConsole::updateNetworkState(), BitcoinGUI::updateNetworkState(), and BitcoinGUI::updateProgressBarVisibility().
◆ getNumBlocks()
int ClientModel::getNumBlocks | ( | ) | const |
Definition at line 100 of file clientmodel.cpp.
References chainActive, cs_main, CChain::Height(), and LOCK.
Referenced by OverviewPage::privateSendStatus(), BitcoinGUI::setAdditionalDataSyncProgress(), RPCConsole::setClientModel(), BitcoinGUI::setClientModel(), and BitcoinGUI::updateNetworkState().
◆ getNumConnections()
int ClientModel::getNumConnections | ( | unsigned int | flags = CONNECTIONS_ALL | ) | const |
Return number of connections, default is in- and outbound (total)
Definition at line 62 of file clientmodel.cpp.
References CONNECTIONS_ALL, CConnman::CONNECTIONS_ALL, CONNECTIONS_IN, CConnman::CONNECTIONS_IN, CConnman::CONNECTIONS_NONE, CONNECTIONS_OUT, CConnman::CONNECTIONS_OUT, flags, and g_connman.
Referenced by getBlockSource(), BitcoinGUI::setAdditionalDataSyncProgress(), RPCConsole::setClientModel(), BitcoinGUI::setClientModel(), RPCConsole::updateNetworkState(), BitcoinGUI::updateNetworkState(), and BitcoinGUI::updateProgressBarVisibility().
◆ getOptionsModel()
OptionsModel * ClientModel::getOptionsModel | ( | ) |
Definition at line 255 of file clientmodel.cpp.
References optionsModel.
Referenced by BitcoinGUI::changeEvent(), BitcoinGUI::closeEvent(), BitcoinApplication::initializeResult(), BitcoinGUI::optionsClicked(), and BitcoinGUI::setClientModel().
◆ getPeerTableModel()
PeerTableModel * ClientModel::getPeerTableModel | ( | ) |
Definition at line 260 of file clientmodel.cpp.
References peerTableModel.
Referenced by RPCConsole::banSelectedNode(), RPCConsole::hideEvent(), RPCConsole::peerLayoutAboutToChange(), RPCConsole::peerLayoutChanged(), RPCConsole::peerSelected(), RPCConsole::setClientModel(), and RPCConsole::showEvent().
◆ getStatusBarWarnings()
QString ClientModel::getStatusBarWarnings | ( | ) | const |
Return warnings to be displayed in status bar.
Definition at line 250 of file clientmodel.cpp.
References GetWarnings().
Referenced by OverviewPage::setClientModel(), and updateAlert().
◆ getTotalBytesRecv()
quint64 ClientModel::getTotalBytesRecv | ( | ) | const |
Definition at line 132 of file clientmodel.cpp.
References g_connman.
Referenced by TrafficGraphWidget::clear(), TrafficGraphWidget::setClientModel(), and TrafficGraphWidget::updateRates().
◆ getTotalBytesSent()
quint64 ClientModel::getTotalBytesSent | ( | ) | const |
Definition at line 139 of file clientmodel.cpp.
References g_connman.
Referenced by TrafficGraphWidget::clear(), TrafficGraphWidget::setClientModel(), and TrafficGraphWidget::updateRates().
◆ getVerificationProgress()
double ClientModel::getVerificationProgress | ( | const CBlockIndex * | tip | ) | const |
Definition at line 184 of file clientmodel.cpp.
References chainActive, cs_main, GuessVerificationProgress(), LOCK, Params(), and CChain::Tip().
Referenced by BlockTipChanged(), BitcoinGUI::setAdditionalDataSyncProgress(), RPCConsole::setClientModel(), BitcoinGUI::setClientModel(), and BitcoinGUI::updateNetworkState().
◆ inInitialBlockDownload()
bool ClientModel::inInitialBlockDownload | ( | ) | const |
Return true if core is doing initial block download.
Definition at line 218 of file clientmodel.cpp.
References IsInitialBlockDownload().
Referenced by WalletView::processNewTransaction().
◆ islockCountChanged
|
signal |
Referenced by updateTimer().
◆ isReleaseVersion()
bool ClientModel::isReleaseVersion | ( | ) | const |
Definition at line 280 of file clientmodel.cpp.
◆ masternodeListChanged
|
signal |
Referenced by setMasternodeList().
◆ mempoolSizeChanged
|
signal |
Referenced by updateTimer().
◆ message
|
signal |
Fired when a message should be reported to the user.
◆ networkActiveChanged
|
signal |
Referenced by updateNetworkActive().
◆ numBlocksChanged
|
signal |
◆ numConnectionsChanged
|
signal |
Referenced by updateNumConnections().
◆ refreshMasternodeList()
void ClientModel::refreshMasternodeList | ( | ) |
Definition at line 94 of file clientmodel.cpp.
References cs_mnlinst, deterministicMNManager, LOCK, and setMasternodeList().
Referenced by RPCConsole::setClientModel().
◆ setMasternodeList()
void ClientModel::setMasternodeList | ( | const CDeterministicMNList & | mnList | ) |
Definition at line 78 of file clientmodel.cpp.
References cs_mnlinst, CDeterministicMNList::GetBlockHash(), LOCK, masternodeListChanged(), and mnListCached.
Referenced by NotifyMasternodeListChanged(), and refreshMasternodeList().
◆ setNetworkActive()
void ClientModel::setNetworkActive | ( | bool | active | ) |
Toggle network activity state in core.
Definition at line 235 of file clientmodel.cpp.
References g_connman.
Referenced by BitcoinGUI::toggleNetworkActive().
◆ showProgress
|
signal |
◆ subscribeToCoreSignals()
|
private |
Definition at line 374 of file clientmodel.cpp.
References CClientUIInterface::BannedListChanged, BannedListChanged(), BlockTipChanged(), CClientUIInterface::NotifyAdditionalDataSyncProgressChanged, NotifyAdditionalDataSyncProgressChanged(), CClientUIInterface::NotifyAlertChanged, NotifyAlertChanged(), CClientUIInterface::NotifyBlockTip, CClientUIInterface::NotifyHeaderTip, CClientUIInterface::NotifyMasternodeListChanged, NotifyMasternodeListChanged(), CClientUIInterface::NotifyNetworkActiveChanged, NotifyNetworkActiveChanged(), CClientUIInterface::NotifyNumConnectionsChanged, NotifyNumConnectionsChanged(), CClientUIInterface::ShowProgress, ShowProgress(), and uiInterface.
Referenced by ClientModel().
◆ unsubscribeFromCoreSignals()
|
private |
Definition at line 388 of file clientmodel.cpp.
References CClientUIInterface::BannedListChanged, BannedListChanged(), BlockTipChanged(), CClientUIInterface::NotifyAdditionalDataSyncProgressChanged, NotifyAdditionalDataSyncProgressChanged(), CClientUIInterface::NotifyAlertChanged, NotifyAlertChanged(), CClientUIInterface::NotifyBlockTip, CClientUIInterface::NotifyHeaderTip, CClientUIInterface::NotifyMasternodeListChanged, NotifyMasternodeListChanged(), CClientUIInterface::NotifyNetworkActiveChanged, NotifyNetworkActiveChanged(), CClientUIInterface::NotifyNumConnectionsChanged, NotifyNumConnectionsChanged(), CClientUIInterface::ShowProgress, ShowProgress(), and uiInterface.
Referenced by ~ClientModel().
◆ updateAlert
|
slot |
Definition at line 213 of file clientmodel.cpp.
References alertsChanged(), and getStatusBarWarnings().
◆ updateBanlist
|
slot |
Definition at line 295 of file clientmodel.cpp.
References banTableModel, and BanTableModel::refresh().
◆ updateNetworkActive
|
slot |
Definition at line 208 of file clientmodel.cpp.
References networkActiveChanged().
◆ updateNumConnections
|
slot |
Definition at line 203 of file clientmodel.cpp.
References numConnectionsChanged().
◆ updateTimer
|
slot |
Definition at line 195 of file clientmodel.cpp.
References getInstantSentLockCount(), getMempoolDynamicUsage(), getMempoolSize(), islockCountChanged(), and mempoolSizeChanged().
Referenced by ClientModel().
Member Data Documentation
◆ banTableModel
|
private |
Definition at line 101 of file clientmodel.h.
Referenced by ClientModel(), getBanTableModel(), and updateBanlist().
◆ cachedBestHeaderHeight
|
mutable |
Definition at line 95 of file clientmodel.h.
Referenced by BlockTipChanged(), ClientModel(), getHeaderTipHeight(), and getHeaderTipTime().
◆ cachedBestHeaderTime
|
mutable |
Definition at line 96 of file clientmodel.h.
Referenced by BlockTipChanged(), ClientModel(), getHeaderTipHeight(), and getHeaderTipTime().
◆ cs_mnlinst
|
mutableprivate |
Definition at line 108 of file clientmodel.h.
Referenced by getMasternodeList(), refreshMasternodeList(), and setMasternodeList().
◆ mnListCached
|
private |
Definition at line 109 of file clientmodel.h.
Referenced by getMasternodeList(), and setMasternodeList().
◆ optionsModel
|
private |
Definition at line 99 of file clientmodel.h.
Referenced by getOptionsModel().
◆ peerTableModel
|
private |
Definition at line 100 of file clientmodel.h.
Referenced by ClientModel(), and getPeerTableModel().
◆ pollTimer
|
private |
Definition at line 103 of file clientmodel.h.
Referenced by ClientModel().
The documentation for this class was generated from the following files:
- src/qt/clientmodel.h
- src/qt/clientmodel.cpp