Skip to content

Commit

Permalink
Merge #10500: Avoid CWalletTx copies in GetAddressBalances and GetAdd…
Browse files Browse the repository at this point in the history
…ressGroupings

Summary:
b9b814a Avoid CWalletTx copies in GetAddressBalances and GetAddressGroupings (Russell Yanofsky)

Tree-SHA512: 96a0612ca460ba1bfb3921f3aa348400fd3afa12c40f2ca1f3f04068b1574fe824d577e0123013d8898a4990084316dc1dfb541331849f0996ceff7f4eb25e6b

Backport of Core PR10500
bitcoin/bitcoin#10500

Test Plan:
  make check
  test_runner.py

Reviewers: jasonbcox, Fabien, deadalnix, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3239
  • Loading branch information
sipa authored and Nico Guiton committed Jun 6, 2019
1 parent b05b098 commit ff61577
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3726,8 +3726,8 @@ std::map<CTxDestination, Amount> CWallet::GetAddressBalances() {
std::map<CTxDestination, Amount> balances;

LOCK(cs_wallet);
for (std::pair<TxId, CWalletTx> walletEntry : mapWallet) {
CWalletTx *pcoin = &walletEntry.second;
for (const auto &walletEntry : mapWallet) {
const CWalletTx *pcoin = &walletEntry.second;

if (!pcoin->IsTrusted()) {
continue;
Expand Down Expand Up @@ -3772,8 +3772,8 @@ std::set<std::set<CTxDestination>> CWallet::GetAddressGroupings() {
std::set<std::set<CTxDestination>> groupings;
std::set<CTxDestination> grouping;

for (std::pair<uint256, CWalletTx> walletEntry : mapWallet) {
CWalletTx *pcoin = &walletEntry.second;
for (const auto &walletEntry : mapWallet) {
const CWalletTx *pcoin = &walletEntry.second;

if (pcoin->tx->vin.size() > 0) {
bool any_mine = false;
Expand Down

0 comments on commit ff61577

Please sign in to comment.