Skip to content

Commit 21eda43

Browse files
committed
Merge #19828: wallet, refactor: Remove duplicate map lookups in GetAddressBalances
b35e74b 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 b35e74b theStack: ACK b35e74b practicalswift: ACK b35e74b Tree-SHA512: a73c1b336406a569e3bb10290618c5950b944db58ed0b05ff202d097684bb3ba3a5942c8d30443960052aa16438c054e2d02977b67aa901cce665c4df0ee5602
2 parents f89b4f8 + b35e74b commit 21eda43

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/wallet/wallet.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3372,9 +3372,6 @@ std::map<CTxDestination, CAmount> CWallet::GetAddressBalances() const
33723372
continue;
33733373

33743374
CAmount n = IsSpent(walletEntry.first, i) ? 0 : wtx.tx->vout[i].nValue;
3375-
3376-
if (!balances.count(addr))
3377-
balances[addr] = 0;
33783375
balances[addr] += n;
33793376
}
33803377
}

0 commit comments

Comments
 (0)