mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-02-05 11:44:25 +00:00
Merge pull request #4718
88fe88c gui: remove redundant numTransactions tracking (Wladimir J. van der Laan)
This commit is contained in:
commit
92b3d3630d
@ -31,7 +31,6 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p
|
|||||||
transactionTableModel(0),
|
transactionTableModel(0),
|
||||||
recentRequestsTableModel(0),
|
recentRequestsTableModel(0),
|
||||||
cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0),
|
cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0),
|
||||||
cachedNumTransactions(0),
|
|
||||||
cachedEncryptionStatus(Unencrypted),
|
cachedEncryptionStatus(Unencrypted),
|
||||||
cachedNumBlocks(0)
|
cachedNumBlocks(0)
|
||||||
{
|
{
|
||||||
@ -96,18 +95,6 @@ qint64 WalletModel::getWatchImmatureBalance() const
|
|||||||
return wallet->GetImmatureWatchOnlyBalance();
|
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()
|
void WalletModel::updateStatus()
|
||||||
{
|
{
|
||||||
EncryptionStatus newEncryptionStatus = getEncryptionStatus();
|
EncryptionStatus newEncryptionStatus = getEncryptionStatus();
|
||||||
@ -169,13 +156,6 @@ void WalletModel::updateTransaction(const QString &hash, int status)
|
|||||||
|
|
||||||
// Balance and number of transactions might have changed
|
// Balance and number of transactions might have changed
|
||||||
checkBalanceChanged();
|
checkBalanceChanged();
|
||||||
|
|
||||||
int newNumTransactions = getNumTransactions();
|
|
||||||
if(cachedNumTransactions != newNumTransactions)
|
|
||||||
{
|
|
||||||
cachedNumTransactions = newNumTransactions;
|
|
||||||
emit numTransactionsChanged(newNumTransactions);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WalletModel::updateAddressBook(const QString &address, const QString &label,
|
void WalletModel::updateAddressBook(const QString &address, const QString &label,
|
||||||
|
@ -131,7 +131,6 @@ public:
|
|||||||
qint64 getWatchBalance() const;
|
qint64 getWatchBalance() const;
|
||||||
qint64 getWatchUnconfirmedBalance() const;
|
qint64 getWatchUnconfirmedBalance() const;
|
||||||
qint64 getWatchImmatureBalance() const;
|
qint64 getWatchImmatureBalance() const;
|
||||||
int getNumTransactions() const;
|
|
||||||
EncryptionStatus getEncryptionStatus() const;
|
EncryptionStatus getEncryptionStatus() const;
|
||||||
bool processingQueuedTransactions() { return fProcessingQueuedTransactions; }
|
bool processingQueuedTransactions() { return fProcessingQueuedTransactions; }
|
||||||
|
|
||||||
@ -214,7 +213,6 @@ private:
|
|||||||
qint64 cachedWatchOnlyBalance;
|
qint64 cachedWatchOnlyBalance;
|
||||||
qint64 cachedWatchUnconfBalance;
|
qint64 cachedWatchUnconfBalance;
|
||||||
qint64 cachedWatchImmatureBalance;
|
qint64 cachedWatchImmatureBalance;
|
||||||
qint64 cachedNumTransactions;
|
|
||||||
EncryptionStatus cachedEncryptionStatus;
|
EncryptionStatus cachedEncryptionStatus;
|
||||||
int cachedNumBlocks;
|
int cachedNumBlocks;
|
||||||
|
|
||||||
@ -229,9 +227,6 @@ signals:
|
|||||||
void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance,
|
void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance,
|
||||||
qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance);
|
qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance);
|
||||||
|
|
||||||
// Number of transactions in wallet changed
|
|
||||||
void numTransactionsChanged(int count);
|
|
||||||
|
|
||||||
// Encryption status of wallet changed
|
// Encryption status of wallet changed
|
||||||
void encryptionStatusChanged(int status);
|
void encryptionStatusChanged(int status);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user