28 static const int64_t nClientStartupTime =
GetTime();
32 optionsModel(optionsModel),
35 cachedReindexing(0), cachedImporting(0),
36 numBlocksAtStartup(-1), pollTimer(0)
93 return QDateTime::fromTime_t(
Params().GenesisBlock().nTime);
139 hash_256.
SetHex(hash.toStdString());
152 QString netname(QString::fromStdString(
Params().DataDir()));
153 if(netname.isEmpty())
162 QString ClientModel::formatI2PNativeFullVersion()
const
164 return QString::fromStdString(FormatI2PNativeFullVersion());
167 void ClientModel::updateNumI2PConnections(
int numI2PConnections)
169 emit numI2PConnectionsChanged(numI2PConnections);
172 int ClientModel::getNumI2PConnections()
const
174 return nI2PNodeCount;
177 QString ClientModel::getPublicI2PKey()
const
179 return IsI2PEnabled() ? QString::fromStdString(
I2PSession::Instance().getMyDestination().pub) : QString(
"Not Available" );
182 QString ClientModel::getPrivateI2PKey()
const
184 return IsI2PEnabled() ? QString::fromStdString(
I2PSession::Instance().getMyDestination().priv) : QString(
"Not Available" );
187 bool ClientModel::isI2PAddressGenerated()
const
192 bool ClientModel::isI2POnly()
const
197 bool ClientModel::isTorOnly()
const
202 bool ClientModel::isDarknetOnly()
const
204 return IsDarknetOnly();
207 bool ClientModel::isBehindDarknet()
const
209 return IsBehindDarknet();
212 QString ClientModel::getB32Address(
const QString& destination)
const
217 void ClientModel::generateI2PDestination(QString& pub, QString& priv)
const
222 pub = QString::fromStdString(generatedDest.pub);
223 priv = QString::fromStdString(generatedDest.priv);
225 #endif // ENABLE_I2PSAM
246 return QString::fromStdString(
GetWarnings(
"statusbar"));
281 return QDateTime::fromTime_t(nClientStartupTime).toString();
285 static void NotifyBlocksChanged(
ClientModel *clientmodel)
291 static void NotifyNumConnectionsChanged(
ClientModel *clientmodel,
int newNumConnections)
294 QMetaObject::invokeMethod(clientmodel,
"updateNumConnections", Qt::QueuedConnection,
295 Q_ARG(
int, newNumConnections));
299 static void NotifyNumI2PConnectionsChanged(
ClientModel *clientmodel,
int newNumI2PConnections)
301 QMetaObject::invokeMethod(clientmodel,
"updateNumI2PConnections", Qt::QueuedConnection,
302 Q_ARG(
int, newNumI2PConnections));
304 #endif // ENABLE_I2PSAM
308 qDebug() <<
"NotifyAlertChanged : " + QString::fromStdString(hash.
GetHex()) +
" status=" + QString::number(status);
309 QMetaObject::invokeMethod(clientmodel,
"updateAlert", Qt::QueuedConnection,
310 Q_ARG(QString, QString::fromStdString(hash.
GetHex())),
321 uiInterface.NotifyNumI2PConnectionsChanged.connect(boost::bind(NotifyNumI2PConnectionsChanged,
this, _1));
332 uiInterface.NotifyNumI2PConnectionsChanged.disconnect(boost::bind(NotifyNumI2PConnectionsChanged,
this, _1));
void numBlocksChanged(int count)
CClientUIInterface uiInterface
void SetHex(const char *psz)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
PeerTableModel * peerTableModel
static uint64_t GetTotalBytesRecv()
#define TRY_LOCK(cs, name)
const SAM::FullDestination & getMyDestination() const
static SAM::StreamSessionAdapter & Instance()
quint64 getTotalBytesRecv() const
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
string GetWarnings(string strFor)
OptionsModel * getOptionsModel()
QString formatClientStartupTime() const
PeerTableModel * getPeerTableModel()
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
void numConnectionsChanged(int count)
Note signal functions like this are created here in the header file, yet no source implmentation will...
CChain chainActive
The currently-connected chain of blocks.
bool isReleaseVersion() const
void alertsChanged(const QString &warnings)
QString getNetworkName() const
Return network (main, testnetX, regtest)
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
#define CLIENT_VERSION_IS_RELEASE
bool inInitialBlockDownload() const
Return true if core is doing initial block download.
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or NULL if none.
int Height() const
Return the maximal height in the chain.
double getVerificationProgress() const
ChangeType
General change type (added, updated, removed).
bool IsInitialBlockDownload()
Check whether we are doing an initial block download (synchronizing from disk or network) ...
An alert is a combination of a serialized CUnsignedAlert and a signature.
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call...
QDateTime getLastBlockDate() const
void updateAlert(const QString &hash, int status)
void unsubscribeFromCoreSignals()
QString clientName() const
void subscribeToCoreSignals()
QString formatBuildDate() const
const std::string CLIENT_NAME
static uint64_t GetTotalBytesSent()
std::string GetHex() const
Model for Anoncoin network client.
double GuessVerificationProgress(CBlockIndex *pindex, bool fSigchecks)
std::string FormatFullVersion()
const std::string CLIENT_DATE
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
quint64 getTotalBytesSent() const
ClientModel(OptionsModel *optionsModel, QObject *parent=0)
boost::signals2::signal< void(const uint256 &hash, ChangeType status)> NotifyAlertChanged
New, updated or cancelled alert.
Interface from Qt to configuration data structure for Anoncoin client.
const CChainParams & Params()
Return the currently selected parameters.
void updateTimer()
From: https://qt-project.org/doc/qt-5-snapshot/signalsandslots.html A slot is a function that is call...
static CAlert getAlertByHash(const uint256 &hash)
boost::signals2::signal< void()> NotifyBlocksChanged
Block chain changed.
static std::string GenerateB32AddressFromDestination(const std::string &destination)
SAM::FullDestination destGenerate() const
OptionsModel * optionsModel
int getNumBlocksAtStartup()
Information about a peer.
void updateNumConnections(int numConnections)
int64_t GetBlockTime() const
QString formatFullVersion() const
CCriticalSection cs_vNodes
enum BlockSource getBlockSource() const
Return true if core is importing blocks.