Skip to content

Commit

Permalink
gui: remove redundant numTransactions tracking
Browse files Browse the repository at this point in the history
This number was still tracked even though it's shown nowhere in the UI
anymore. It was originally removed because it didn't match the actual number of
records in the view (which contains outputs, not transactions) thus was
confusing people.
  • Loading branch information
laanwj committed Aug 18, 2014
1 parent 21e7a56 commit 88fe88c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
20 changes: 0 additions & 20 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p
transactionTableModel(0),
recentRequestsTableModel(0),
cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0),
cachedNumTransactions(0),
cachedEncryptionStatus(Unencrypted),
cachedNumBlocks(0)
{
Expand Down Expand Up @@ -96,18 +95,6 @@ qint64 WalletModel::getWatchImmatureBalance() const
return wallet->GetImmatureWatchOnlyBalance();
}

int WalletModel::getNumTransactions() const
{
int numTransactions = 0;
{
LOCK(wallet->cs_wallet);
// the size of mapWallet contains the number of unique transaction IDs
// (e.g. payments to yourself generate 2 transactions, but both share the same transaction ID)
numTransactions = wallet->mapWallet.size();
}
return numTransactions;
}

void WalletModel::updateStatus()
{
EncryptionStatus newEncryptionStatus = getEncryptionStatus();
Expand Down Expand Up @@ -169,13 +156,6 @@ void WalletModel::updateTransaction(const QString &hash, int status)

// Balance and number of transactions might have changed
checkBalanceChanged();

int newNumTransactions = getNumTransactions();
if(cachedNumTransactions != newNumTransactions)
{
cachedNumTransactions = newNumTransactions;
emit numTransactionsChanged(newNumTransactions);
}
}

void WalletModel::updateAddressBook(const QString &address, const QString &label,
Expand Down
5 changes: 0 additions & 5 deletions src/qt/walletmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ class WalletModel : public QObject
qint64 getWatchBalance() const;
qint64 getWatchUnconfirmedBalance() const;
qint64 getWatchImmatureBalance() const;
int getNumTransactions() const;
EncryptionStatus getEncryptionStatus() const;
bool processingQueuedTransactions() { return fProcessingQueuedTransactions; }

Expand Down Expand Up @@ -214,7 +213,6 @@ class WalletModel : public QObject
qint64 cachedWatchOnlyBalance;
qint64 cachedWatchUnconfBalance;
qint64 cachedWatchImmatureBalance;
qint64 cachedNumTransactions;
EncryptionStatus cachedEncryptionStatus;
int cachedNumBlocks;

Expand All @@ -229,9 +227,6 @@ class WalletModel : public QObject
void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance,
qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance);

// Number of transactions in wallet changed
void numTransactionsChanged(int count);

// Encryption status of wallet changed
void encryptionStatusChanged(int status);

Expand Down

0 comments on commit 88fe88c

Please sign in to comment.