PosTab
[novacoin.git] / src / qt / walletmodel.cpp
index b14388a..b8e5236 100644 (file)
@@ -2,6 +2,7 @@
 #include "guiconstants.h"
 #include "optionsmodel.h"
 #include "addresstablemodel.h"
+#include "mintingtablemodel.h"
 #include "transactiontablemodel.h"
 
 #include "ui_interface.h"
@@ -21,6 +22,7 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p
     cachedNumBlocks(0)
 {
     addressTableModel = new AddressTableModel(wallet, this);
+    mintingTableModel = new MintingTableModel(wallet, this);
     transactionTableModel = new TransactionTableModel(wallet, this);
 
     // This timer will be fired repeatedly to update the balance
@@ -41,9 +43,9 @@ qint64 WalletModel::getBalance() const
     return wallet->GetBalance();
 }
 
-void WalletModel::getBalance(qint64 &nTotal, qint64 &nWatchOnly) const
+qint64 WalletModel::getBalanceWatchOnly() const
 {
-    wallet->GetBalance(nTotal, nWatchOnly);
+    return wallet->GetWatchOnlyBalance();
 }
 
 qint64 WalletModel::getUnconfirmedBalance() const
@@ -91,9 +93,7 @@ void WalletModel::pollBalanceChanged()
 
 void WalletModel::checkBalanceChanged()
 {
-    qint64 newBalanceTotal=0, newBalanceWatchOnly=0;
-    getBalance(newBalanceTotal, newBalanceWatchOnly);
-
+    qint64 newBalanceTotal=getBalance(), newBalanceWatchOnly=getBalanceWatchOnly();
     qint64 newStake = getStake();
     qint64 newUnconfirmedBalance = getUnconfirmedBalance();
     qint64 newImmatureBalance = getImmatureBalance();
@@ -254,6 +254,11 @@ AddressTableModel *WalletModel::getAddressTableModel()
     return addressTableModel;
 }
 
+MintingTableModel *WalletModel::getMintingTableModel()
+{
+    return mintingTableModel;
+}
+
 TransactionTableModel *WalletModel::getTransactionTableModel()
 {
     return transactionTableModel;