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>

+ Inheritance diagram for ClientModel:
+ Collaboration diagram for ClientModel:

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 ()
 
OptionsModelgetOptionsModel ()
 
PeerTableModelgetPeerTableModel ()
 
BanTableModelgetBanTableModel ()
 
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

OptionsModeloptionsModel
 
PeerTableModelpeerTableModel
 
BanTableModelbanTableModel
 
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()

ClientModel::ClientModel ( OptionsModel optionsModel,
QObject *  parent = 0 
)
explicit

◆ ~ClientModel()

ClientModel::~ClientModel ( )

Definition at line 57 of file clientmodel.cpp.

References unsubscribeFromCoreSignals().

Member Function Documentation

◆ additionalDataSyncProgressChanged

void ClientModel::additionalDataSyncProgressChanged ( double  nSyncProgress)
signal

◆ alertsChanged

void ClientModel::alertsChanged ( const QString &  warnings)
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()

◆ 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()

◆ getHeaderTipTime()

◆ 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()

◆ getLastBlockHash()

◆ getMasternodeList()

CDeterministicMNList ClientModel::getMasternodeList ( ) const

◆ 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()

◆ getNumConnections()

◆ getOptionsModel()

◆ getPeerTableModel()

◆ 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

◆ getTotalBytesSent()

quint64 ClientModel::getTotalBytesSent ( ) const

◆ getVerificationProgress()

◆ 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

void ClientModel::islockCountChanged ( size_t  count)
signal

Referenced by updateTimer().

◆ isReleaseVersion()

bool ClientModel::isReleaseVersion ( ) const

Definition at line 280 of file clientmodel.cpp.

◆ masternodeListChanged

void ClientModel::masternodeListChanged ( ) const
signal

Referenced by setMasternodeList().

◆ mempoolSizeChanged

void ClientModel::mempoolSizeChanged ( long  count,
size_t  mempoolSizeInBytes 
)
signal

Referenced by updateTimer().

◆ message

void ClientModel::message ( const QString &  title,
const QString &  message,
unsigned int  style 
)
signal

Fired when a message should be reported to the user.

◆ networkActiveChanged

void ClientModel::networkActiveChanged ( bool  networkActive)
signal

Referenced by updateNetworkActive().

◆ numBlocksChanged

void ClientModel::numBlocksChanged ( int  count,
const QDateTime &  blockDate,
const QString &  blockHash,
double  nVerificationProgress,
bool  header 
)
signal

◆ numConnectionsChanged

void ClientModel::numConnectionsChanged ( int  count)
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)

◆ 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

void ClientModel::showProgress ( const QString &  title,
int  nProgress 
)
signal

◆ subscribeToCoreSignals()

◆ unsubscribeFromCoreSignals()

◆ updateAlert

void ClientModel::updateAlert ( )
slot

Definition at line 213 of file clientmodel.cpp.

References alertsChanged(), and getStatusBarWarnings().

◆ updateBanlist

void ClientModel::updateBanlist ( )
slot

Definition at line 295 of file clientmodel.cpp.

References banTableModel, and BanTableModel::refresh().

◆ updateNetworkActive

void ClientModel::updateNetworkActive ( bool  networkActive)
slot

Definition at line 208 of file clientmodel.cpp.

References networkActiveChanged().

◆ updateNumConnections

void ClientModel::updateNumConnections ( int  numConnections)
slot

Definition at line 203 of file clientmodel.cpp.

References numConnectionsChanged().

◆ updateTimer

void ClientModel::updateTimer ( )
slot

Member Data Documentation

◆ banTableModel

BanTableModel* ClientModel::banTableModel
private

Definition at line 101 of file clientmodel.h.

Referenced by ClientModel(), getBanTableModel(), and updateBanlist().

◆ cachedBestHeaderHeight

std::atomic<int> ClientModel::cachedBestHeaderHeight
mutable

Definition at line 95 of file clientmodel.h.

Referenced by BlockTipChanged(), ClientModel(), getHeaderTipHeight(), and getHeaderTipTime().

◆ cachedBestHeaderTime

std::atomic<int64_t> ClientModel::cachedBestHeaderTime
mutable

Definition at line 96 of file clientmodel.h.

Referenced by BlockTipChanged(), ClientModel(), getHeaderTipHeight(), and getHeaderTipTime().

◆ cs_mnlinst

CCriticalSection ClientModel::cs_mnlinst
mutableprivate

Definition at line 108 of file clientmodel.h.

Referenced by getMasternodeList(), refreshMasternodeList(), and setMasternodeList().

◆ mnListCached

CDeterministicMNList ClientModel::mnListCached
private

Definition at line 109 of file clientmodel.h.

Referenced by getMasternodeList(), and setMasternodeList().

◆ optionsModel

OptionsModel* ClientModel::optionsModel
private

Definition at line 99 of file clientmodel.h.

Referenced by getOptionsModel().

◆ peerTableModel

PeerTableModel* ClientModel::peerTableModel
private

Definition at line 100 of file clientmodel.h.

Referenced by ClientModel(), and getPeerTableModel().

◆ pollTimer

QTimer* ClientModel::pollTimer
private

Definition at line 103 of file clientmodel.h.

Referenced by ClientModel().


The documentation for this class was generated from the following files:
Released under the MIT license