aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorfanquake <[email protected]>2020-08-31 10:05:17 +0800
committerfanquake <[email protected]>2020-08-31 10:24:18 +0800
commit21eda43cdea808335385af5c35f3baa77239749c (patch)
treef677420ab98452dadec7385a3732cb3b26467c0f /src/wallet
parentMerge #19830: test: Add tsan supp for leveldb::DBImpl::DeleteObsoleteFiles (diff)
parentwallet, refactor: Remove duplicate map lookups in GetAddressBalances (diff)
downloaddiscoin-21eda43cdea808335385af5c35f3baa77239749c.tar.xz
discoin-21eda43cdea808335385af5c35f3baa77239749c.zip
Merge #19828: wallet, refactor: Remove duplicate map lookups in GetAddressBalances
b35e74ba379bdc12ea6d49a45469f0d6aa74cc27 wallet, refactor: Remove duplicate map lookups in GetAddressBalances (João Barbosa) Pull request description: Now just one lookup in `balances` instead of three. ACKs for top commit: achow101: ACK b35e74ba379bdc12ea6d49a45469f0d6aa74cc27 theStack: ACK b35e74ba379bdc12ea6d49a45469f0d6aa74cc27 practicalswift: ACK b35e74ba379bdc12ea6d49a45469f0d6aa74cc27 Tree-SHA512: a73c1b336406a569e3bb10290618c5950b944db58ed0b05ff202d097684bb3ba3a5942c8d30443960052aa16438c054e2d02977b67aa901cce665c4df0ee5602
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index fa00d1255..0627522ee 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -3372,9 +3372,6 @@ std::map<CTxDestination, CAmount> CWallet::GetAddressBalances() const
continue;
CAmount n = IsSpent(walletEntry.first, i) ? 0 : wtx.tx->vout[i].nValue;
-
- if (!balances.count(addr))
- balances[addr] = 0;
balances[addr] += n;
}
}