QObject(parent), optionsModel(0), addressTableModel(0),
transactionTableModel(0)
{
- /* Until signal notifications is built into the bitcoin core,
- simply update everything after polling using a timer.
- */
+ // Until signal notifications is built into the bitcoin core,
+ // simply update everything after polling using a timer.
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(MODEL_UPDATE_DELAY);
transactionTableModel = new TransactionTableModel(this);
}
-qint64 ClientModel::getBalance()
+qint64 ClientModel::getBalance() const
{
return GetBalance();
}
-QString ClientModel::getAddress()
+QString ClientModel::getAddress() const
{
std::vector<unsigned char> vchPubKey;
if (CWalletDB("r").ReadDefaultKey(vchPubKey))
}
}
-int ClientModel::getNumConnections()
+int ClientModel::getNumConnections() const
{
return vNodes.size();
}
-int ClientModel::getNumBlocks()
+int ClientModel::getNumBlocks() const
{
return nBestHeight;
}
-int ClientModel::getNumTransactions()
+int ClientModel::getNumTransactions() const
{
int numTransactions = 0;
CRITICAL_BLOCK(cs_mapWallet)
void ClientModel::update()
{
- /* Plainly emit all signals for now. To be precise this should check
- wether the values actually changed first.
- */
+ // Plainly emit all signals for now. To be more efficient this should check
+ // whether the values actually changed first.
emit balanceChanged(getBalance());
emit addressChanged(getAddress());
emit numConnectionsChanged(getNumConnections());
return OK;
}
+bool ClientModel::inInitialBlockDownload() const
+{
+ return IsInitialBlockDownload();
+}
+
+int ClientModel::getTotalBlocksEstimate() const
+{
+ return GetTotalBlocksEstimate();
+}
+
+
OptionsModel *ClientModel::getOptionsModel()
{
return optionsModel;