Skip to content

Commit b9b814a

Browse files
committed
Avoid CWalletTx copies in GetAddressBalances and GetAddressGroupings
1 parent 7e96ecf commit b9b814a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/wallet/wallet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,9 +3261,9 @@ std::map<CTxDestination, CAmount> CWallet::GetAddressBalances()
32613261

32623262
{
32633263
LOCK(cs_wallet);
3264-
BOOST_FOREACH(PAIRTYPE(uint256, CWalletTx) walletEntry, mapWallet)
3264+
for (const auto& walletEntry : mapWallet)
32653265
{
3266-
CWalletTx *pcoin = &walletEntry.second;
3266+
const CWalletTx *pcoin = &walletEntry.second;
32673267

32683268
if (!pcoin->IsTrusted())
32693269
continue;
@@ -3301,9 +3301,9 @@ std::set< std::set<CTxDestination> > CWallet::GetAddressGroupings()
33013301
std::set< std::set<CTxDestination> > groupings;
33023302
std::set<CTxDestination> grouping;
33033303

3304-
BOOST_FOREACH(PAIRTYPE(uint256, CWalletTx) walletEntry, mapWallet)
3304+
for (const auto& walletEntry : mapWallet)
33053305
{
3306-
CWalletTx *pcoin = &walletEntry.second;
3306+
const CWalletTx *pcoin = &walletEntry.second;
33073307

33083308
if (pcoin->tx->vin.size() > 0)
33093309
{

0 commit comments

Comments
 (0)