 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
31 static const int64_t nClientStartupTime =
GetTime();
33 static int64_t nLastBlockTipUpdateNotification = 0;
36 optionsModel(optionsModel),
40 cachedMasternodeCountString(
""),
41 cachedReindexing(0), cachedImporting(0),
42 numBlocksAtStartup(-1), pollTimer(0)
77 int ipv4 = 0, ipv6 = 0, onion = 0;
80 if(nUnknown < 0) nUnknown = 0;
81 return tr(
"Total: %1 (IPv4: %2 / IPv6: %3 / Tor: %4 / Unknown: %5)").arg(QString::number((
int)
mnodeman.
size())).arg(QString::number((
int)ipv4)).arg(QString::number((
int)ipv6)).arg(QString::number((
int)onion)).arg(QString::number((
int)nUnknown));
112 return QDateTime::fromTime_t(nTime);
118 return QString::fromStdString(nHash.
GetHex());
195 return QString::fromStdString(
GetWarnings(
"statusbar"));
230 return QDateTime::fromTime_t(nClientStartupTime).toString();
253 if (!initialSync || now - nLastBlockTipUpdateNotification > MODEL_UPDATE_DELAY) {
260 nLastBlockTipUpdateNotification = now;
265 static void ShowProgress(
ClientModel* clientmodel,
const std::string& title,
int nProgress)
268 QMetaObject::invokeMethod(clientmodel,
"showProgress", Qt::QueuedConnection,
269 Q_ARG(QString, QString::fromStdString(title)),
270 Q_ARG(
int, nProgress));
273 static void NotifyNumConnectionsChanged(
ClientModel* clientmodel,
int newNumConnections)
276 QMetaObject::invokeMethod(clientmodel,
"updateNumConnections", Qt::QueuedConnection,
277 Q_ARG(
int, newNumConnections));
280 static void NotifyAlertChanged(
ClientModel* clientmodel)
282 qDebug() <<
"NotifyAlertChanged";
283 QMetaObject::invokeMethod(clientmodel,
"updateAlert", Qt::QueuedConnection);
286 static void BannedListChanged(
ClientModel *clientmodel)
288 qDebug() << QString(
"%1: Requesting update for peer banlist").arg(__func__);
289 QMetaObject::invokeMethod(clientmodel,
"updateBanlist", Qt::QueuedConnection);
318 for (
const std::pair<CNetAddr, LocalServiceInfo> &item :
mapLocalHost) {
319 if (item.first.IsTor()) {
void alertsChanged(const QString &warnings)
int64_t GetBlockTime() const
A combination of a network address (CNetAddr) and a (TCP) port.
std::atomic< bool > fImporting
void startMasternodesTimer()
void subscribeToCoreSignals()
std::vector< CNode * > vNodes
QString boostPathToQString(const fs::path &path)
QString getLastBlockHash() const
void numConnectionsChanged(int count)
int64_t GetTime()
For unit testing.
bool inInitialBlockDownload() const
Return true if core is doing initial block download.
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
std::string GetHex() const
bool isReleaseVersion() const
CChain chainActive
The currently-connected chain of blocks.
CClientUIInterface uiInterface
static uint64_t GetTotalBytesRecv()
bool getTorInfo(std::string &ip_port) const
ClientModel(OptionsModel *optionsModel, QObject *parent=0)
int nHeight
height of the entry in the chain. The genesis block has height 0
Information about a peer.
enum BlockSource getBlockSource() const
Return true if core is importing blocks.
boost::signals2::signal< void(void)> BannedListChanged
Banlist did change.
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
int size()
Return the number of (unique) Masternodes.
#define TRY_LOCK(cs, name)
void setCacheImporting(bool import)
const CBlockIndex * cacheTip
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call.
BanTableModel * banTableModel
std::string ToStringIPPort() const
int getNumBlocksAtStartup()
RecursiveMutex cs_main
Global state.
int ActiveProtocol()
See whether the protocol update is enforced for connected nodes.
Interface from Qt to configuration data structure for Bitcoin client.
OptionsModel * getOptionsModel()
void unsubscribeFromCoreSignals()
CMasternodeMan mnodeman
Masternode manager.
QString cachedMasternodeCountString
PeerTableModel * getPeerTableModel()
std::string GetWarnings(std::string strFor)
Format a string that describes several potential problems detected by the core.
bool IsReachable(enum Network net)
check whether a given network is one we can probably connect to
const std::string CLIENT_NAME
RecursiveMutex cs_mapLocalHost
QString getMasternodeCountString() const
void setCacheReindexing(bool reindex)
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
void setCacheTip(const CBlockIndex *const tip)
QString clientName() const
boost::signals2::signal< void()> NotifyAlertChanged
New, updated or cancelled alert.
QString formatFullVersion() const
const CBlock & GenesisBlock() const
256-bit unsigned big integer.
PeerTableModel * peerTableModel
OptionsModel * optionsModel
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call.
void updateNumConnections(int numConnections)
quint64 getTotalBytesSent() const
double getVerificationProgress() const
uint256 GetBlockHash() const
std::map< CNetAddr, LocalServiceInfo > mapLocalHost
void CountNetworks(int protocolVersion, int &ipv4, int &ipv6, int &onion)
Model for PRCY network client.
double GuessVerificationProgress(const CBlockIndex *pindex, bool fSigchecks)
Guess how far we are in the verification process at the given block index.
void setCacheInitialSync(bool _initialSync)
static uint64_t GetTotalBytesSent()
std::atomic< bool > fReindex
QString formatClientStartupTime() const
CService LookupNumeric(const char *pszName, int portDefault)
const fs::path & GetDataDir(bool fNetSpecific)
const CChainParams & Params()
Return the currently selected parameters.
bool GetProxy(enum Network net, proxyType &proxyInfoOut)
void strMasternodesChanged(const QString &strMasternodes)
CBlockIndex * Tip(bool fProofOfStake=false) const
Returns the index entry for the tip of this chain, or NULL if none.
std::string FormatFullVersion()
boost::signals2::signal< void(bool fInitialDownload, const CBlockIndex *newTip)> NotifyBlockTip
New block has been accepted.
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Show progress e.g.
void numBlocksChanged(int count)
The block chain is a tree shaped structure starting with the genesis block at the root,...
QDateTime getLastBlockDate() const
void stopMasternodesTimer()
quint64 getTotalBytesRecv() const
#define CLIENT_VERSION_IS_RELEASE
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
BanTableModel * getBanTableModel()