PIVX Core  5.6.99
P2P Digital Currency
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ClientModel Class Reference

Model for PIVX network client. More...

#include <clientmodel.h>

Inheritance diagram for ClientModel:
[legend]
Collaboration diagram for ClientModel:
[legend]

Public Slots

void updateTimer ()
 
void updateMnTimer ()
 
void updateNumConnections (int numConnections)
 
void updateNetworkActive (bool networkActive)
 
void updateAlert ()
 
void updateBanlist ()
 

Signals

void numConnectionsChanged (int count)
 
void numBlocksChanged (int count)
 
void networkActiveChanged (bool networkActive)
 
void strMasternodesChanged (const QString &strMasternodes)
 
void alertsChanged (const QString &warnings)
 
void bytesChanged (quint64 totalBytesIn, quint64 totalBytesOut)
 
void message (const QString &title, const QString &message, unsigned int style, bool *ret=nullptr)
 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 getNumBlocksAtStartup ()
 
int getNumBlocks ()
 
QDateTime getLastBlockDate () const
 
QString getLastBlockHash () const
 
uint256 getLastBlockProcessed () const
 
int getLastBlockProcessedHeight () const
 
int64_t getLastBlockProcessedTime () const
 
double getVerificationProgress () const
 
bool isTipCached () const
 
quint64 getTotalBytesRecv () const
 
quint64 getTotalBytesSent () const
 
bool inInitialBlockDownload () const
 Return true if core is doing initial block download. More...
 
enum BlockSource getBlockSource () const
 Return true if core is importing blocks. 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
 
bool isReleaseVersion () const
 
QString clientName () const
 
QString formatClientStartupTime () const
 
QString dataDir () const
 
void setCacheTip (const CBlockIndex *const tip)
 
void setCacheReindexing (bool reindex)
 
void setCacheImporting (bool import)
 
void setCacheInitialSync (bool _initialSync)
 
bool getTorInfo (std::string &ip_port) const
 
void startMasternodesTimer ()
 
void stopMasternodesTimer ()
 
QString getMasternodesCountString ()
 
int getMasternodesCount () const
 

Static Public Member Functions

static void mapPort (bool use_upnp, bool use_natpmp)
 Set the automatic port mapping options. More...
 

Private Member Functions

QString getMasternodeCountString ()
 
void subscribeToCoreSignals ()
 
void unsubscribeFromCoreSignals ()
 

Private Attributes

std::unique_ptr< interfaces::Handlerm_handler_show_progress
 
std::unique_ptr< interfaces::Handlerm_handler_notify_num_connections_changed
 
std::unique_ptr< interfaces::Handlerm_handler_notify_net_activity_changed
 
std::unique_ptr< interfaces::Handlerm_handler_notify_alert_changed
 
std::unique_ptr< interfaces::Handlerm_handler_banned_list_changed
 
std::unique_ptr< interfaces::Handlerm_handler_notify_block_tip
 
OptionsModeloptionsModel
 
PeerTableModelpeerTableModel
 
BanTableModelbanTableModel
 
const CBlockIndexcacheTip {nullptr}
 
QString cachedMasternodeCountString
 
bool cachedReindexing
 
bool cachedImporting
 
std::atomic< bool > cachedInitialSync {false}
 
int numBlocksAtStartup
 
QTimer * pollTimer
 
QTimer * pollMnTimer
 
std::atomic_int m_cached_masternodes_count {0}
 

Detailed Description

Model for PIVX network client.

Definition at line 49 of file clientmodel.h.

Constructor & Destructor Documentation

◆ ClientModel()

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

Definition at line 36 of file clientmodel.cpp.

Here is the call graph for this function:

◆ ~ClientModel()

ClientModel::~ClientModel ( )

Definition at line 58 of file clientmodel.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ alertsChanged

void ClientModel::alertsChanged ( const QString &  warnings)
signal
Here is the caller graph for this function:

◆ bytesChanged

void ClientModel::bytesChanged ( quint64  totalBytesIn,
quint64  totalBytesOut 
)
signal
Here is the caller graph for this function:

◆ clientName()

QString ClientModel::clientName ( ) const

Definition at line 281 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ dataDir()

QString ClientModel::dataDir ( ) const

Definition at line 291 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatClientStartupTime()

QString ClientModel::formatClientStartupTime ( ) const

Definition at line 286 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ formatFullVersion()

QString ClientModel::formatFullVersion ( ) const

Definition at line 271 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBanTableModel()

BanTableModel * ClientModel::getBanTableModel ( )

Definition at line 266 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ getBlockSource()

enum BlockSource ClientModel::getBlockSource ( ) const

Return true if core is importing blocks.

Definition at line 219 of file clientmodel.cpp.

◆ getLastBlockDate()

QDateTime ClientModel::getLastBlockDate ( ) const

Definition at line 131 of file clientmodel.cpp.

Here is the call graph for this function:

◆ getLastBlockHash()

QString ClientModel::getLastBlockHash ( ) const

Definition at line 137 of file clientmodel.cpp.

Here is the call graph for this function:

◆ getLastBlockProcessed()

uint256 ClientModel::getLastBlockProcessed ( ) const

Definition at line 143 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLastBlockProcessedHeight()

int ClientModel::getLastBlockProcessedHeight ( ) const

Definition at line 148 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ getLastBlockProcessedTime()

int64_t ClientModel::getLastBlockProcessedTime ( ) const

Definition at line 153 of file clientmodel.cpp.

Here is the call graph for this function:

◆ getMasternodeCountString()

QString ClientModel::getMasternodeCountString ( )
private

Definition at line 79 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMasternodesCount()

int ClientModel::getMasternodesCount ( ) const
inline

Definition at line 111 of file clientmodel.h.

Here is the caller graph for this function:

◆ getMasternodesCountString()

QString ClientModel::getMasternodesCountString ( )
Todo:
: implement an event based update and remove the lock requirement.

Definition at line 91 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNetworkActive()

bool ClientModel::getNetworkActive ( ) const

Return true if network activity in core is enabled.

Definition at line 243 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ getNumBlocks()

int ClientModel::getNumBlocks ( )

Definition at line 102 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumBlocksAtStartup()

int ClientModel::getNumBlocksAtStartup ( )

Definition at line 111 of file clientmodel.cpp.

Here is the call graph for this function:

◆ getNumConnections()

int ClientModel::getNumConnections ( unsigned int  flags = CONNECTIONS_ALL) const

Return number of connections, default is in- and outbound (total)

Definition at line 63 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ getOptionsModel()

OptionsModel * ClientModel::getOptionsModel ( )

Definition at line 256 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ getPeerTableModel()

PeerTableModel * ClientModel::getPeerTableModel ( )

Definition at line 261 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ getStatusBarWarnings()

QString ClientModel::getStatusBarWarnings ( ) const

Return warnings to be displayed in status bar.

Definition at line 251 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTorInfo()

bool ClientModel::getTorInfo ( std::string &  ip_port) const

Definition at line 382 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTotalBytesRecv()

quint64 ClientModel::getTotalBytesRecv ( ) const

Definition at line 117 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ getTotalBytesSent()

quint64 ClientModel::getTotalBytesSent ( ) const

Definition at line 124 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ getVerificationProgress()

double ClientModel::getVerificationProgress ( ) const

Definition at line 163 of file clientmodel.cpp.

Here is the call graph for this function:

◆ inInitialBlockDownload()

bool ClientModel::inInitialBlockDownload ( ) const

Return true if core is doing initial block download.

Definition at line 219 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ isReleaseVersion()

bool ClientModel::isReleaseVersion ( ) const

Definition at line 276 of file clientmodel.cpp.

◆ isTipCached()

bool ClientModel::isTipCached ( ) const

Definition at line 158 of file clientmodel.cpp.

◆ mapPort()

void ClientModel::mapPort ( bool  use_upnp,
bool  use_natpmp 
)
static

Set the automatic port mapping options.

Definition at line 378 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ message

void ClientModel::message ( const QString &  title,
const QString &  message,
unsigned int  style,
bool *  ret = nullptr 
)
signal

Fired when a message should be reported to the user.

Here is the caller graph for this function:

◆ networkActiveChanged

void ClientModel::networkActiveChanged ( bool  networkActive)
signal
Here is the caller graph for this function:

◆ numBlocksChanged

void ClientModel::numBlocksChanged ( int  count)
signal
Here is the caller graph for this function:

◆ numConnectionsChanged

void ClientModel::numConnectionsChanged ( int  count)
signal
Here is the caller graph for this function:

◆ setCacheImporting()

void ClientModel::setCacheImporting ( bool  import)
inline

Definition at line 97 of file clientmodel.h.

◆ setCacheInitialSync()

void ClientModel::setCacheInitialSync ( bool  _initialSync)
inline

Definition at line 98 of file clientmodel.h.

◆ setCacheReindexing()

void ClientModel::setCacheReindexing ( bool  reindex)
inline

Definition at line 96 of file clientmodel.h.

◆ setCacheTip()

void ClientModel::setCacheTip ( const CBlockIndex *const  tip)
inline

Definition at line 95 of file clientmodel.h.

◆ setNetworkActive()

void ClientModel::setNetworkActive ( bool  active)

Toggle network activity state in core.

Definition at line 236 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ showProgress

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

◆ startMasternodesTimer()

void ClientModel::startMasternodesTimer ( )

Definition at line 189 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ stopMasternodesTimer()

void ClientModel::stopMasternodesTimer ( )

Definition at line 197 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ strMasternodesChanged

void ClientModel::strMasternodesChanged ( const QString &  strMasternodes)
signal
Here is the caller graph for this function:

◆ subscribeToCoreSignals()

void ClientModel::subscribeToCoreSignals ( )
private

Definition at line 356 of file clientmodel.cpp.

Here is the call graph for this function:

◆ unsubscribeFromCoreSignals()

void ClientModel::unsubscribeFromCoreSignals ( )
private

Definition at line 367 of file clientmodel.cpp.

Here is the caller graph for this function:

◆ updateAlert

void ClientModel::updateAlert ( )
slot

Definition at line 214 of file clientmodel.cpp.

Here is the call graph for this function:

◆ updateBanlist

void ClientModel::updateBanlist ( )
slot

Definition at line 296 of file clientmodel.cpp.

Here is the call graph for this function:

◆ updateMnTimer

void ClientModel::updateMnTimer ( )
slot

Definition at line 176 of file clientmodel.cpp.

Here is the call graph for this function:

◆ updateNetworkActive

void ClientModel::updateNetworkActive ( bool  networkActive)
slot

Definition at line 209 of file clientmodel.cpp.

◆ updateNumConnections

void ClientModel::updateNumConnections ( int  numConnections)
slot

Definition at line 204 of file clientmodel.cpp.

◆ updateTimer

void ClientModel::updateTimer ( )
slot

Definition at line 168 of file clientmodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ banTableModel

BanTableModel* ClientModel::banTableModel
private

Definition at line 125 of file clientmodel.h.

◆ cachedImporting

bool ClientModel::cachedImporting
private

Definition at line 130 of file clientmodel.h.

◆ cachedInitialSync

std::atomic<bool> ClientModel::cachedInitialSync {false}
private

Definition at line 131 of file clientmodel.h.

◆ cachedMasternodeCountString

QString ClientModel::cachedMasternodeCountString
private

Definition at line 128 of file clientmodel.h.

◆ cachedReindexing

bool ClientModel::cachedReindexing
private

Definition at line 129 of file clientmodel.h.

◆ cacheTip

const CBlockIndex* ClientModel::cacheTip {nullptr}
private

Definition at line 127 of file clientmodel.h.

◆ m_cached_masternodes_count

std::atomic_int ClientModel::m_cached_masternodes_count {0}
private

Definition at line 138 of file clientmodel.h.

◆ m_handler_banned_list_changed

std::unique_ptr<interfaces::Handler> ClientModel::m_handler_banned_list_changed
private

Definition at line 119 of file clientmodel.h.

◆ m_handler_notify_alert_changed

std::unique_ptr<interfaces::Handler> ClientModel::m_handler_notify_alert_changed
private

Definition at line 118 of file clientmodel.h.

◆ m_handler_notify_block_tip

std::unique_ptr<interfaces::Handler> ClientModel::m_handler_notify_block_tip
private

Definition at line 120 of file clientmodel.h.

◆ m_handler_notify_net_activity_changed

std::unique_ptr<interfaces::Handler> ClientModel::m_handler_notify_net_activity_changed
private

Definition at line 117 of file clientmodel.h.

◆ m_handler_notify_num_connections_changed

std::unique_ptr<interfaces::Handler> ClientModel::m_handler_notify_num_connections_changed
private

Definition at line 116 of file clientmodel.h.

◆ m_handler_show_progress

std::unique_ptr<interfaces::Handler> ClientModel::m_handler_show_progress
private

Definition at line 115 of file clientmodel.h.

◆ numBlocksAtStartup

int ClientModel::numBlocksAtStartup
private

Definition at line 133 of file clientmodel.h.

◆ optionsModel

OptionsModel* ClientModel::optionsModel
private

Definition at line 123 of file clientmodel.h.

◆ peerTableModel

PeerTableModel* ClientModel::peerTableModel
private

Definition at line 124 of file clientmodel.h.

◆ pollMnTimer

QTimer* ClientModel::pollMnTimer
private

Definition at line 136 of file clientmodel.h.

◆ pollTimer

QTimer* ClientModel::pollTimer
private

Definition at line 135 of file clientmodel.h.


The documentation for this class was generated from the following files: