@@ -120,7 +120,7 @@ static void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
120
120
}
121
121
entry.pushKV (" bip125-replaceable" , rbfStatus);
122
122
123
- for (const std::pair<std::string, std::string>& item : wtx.mapValue )
123
+ for (const std::pair<const std::string, std::string>& item : wtx.mapValue )
124
124
entry.pushKV (item.first , item.second );
125
125
}
126
126
@@ -343,7 +343,7 @@ static UniValue setlabel(const JSONRPCRequest& request)
343
343
// If so, delete the account record for it. Labels, unlike addresses, can be deleted,
344
344
// and if we wouldn't do this, the record would stick around forever.
345
345
bool found_address = false ;
346
- for (const std::pair<CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook ) {
346
+ for (const std::pair<const CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook ) {
347
347
if (item.second .name == label) {
348
348
found_address = true ;
349
349
break ;
@@ -440,7 +440,7 @@ static UniValue getaddressesbyaccount(const JSONRPCRequest& request)
440
440
441
441
// Find all addresses that have the given account
442
442
UniValue ret (UniValue::VARR);
443
- for (const std::pair<CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook ) {
443
+ for (const std::pair<const CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook ) {
444
444
const CTxDestination& dest = item.first ;
445
445
const std::string& strName = item.second .name ;
446
446
if (strName == strAccount) {
@@ -753,7 +753,7 @@ static UniValue getreceivedbyaddress(const JSONRPCRequest& request)
753
753
754
754
// Tally
755
755
CAmount nAmount = 0 ;
756
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
756
+ for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
757
757
const CWalletTx& wtx = pairWtx.second ;
758
758
if (wtx.IsCoinBase () || !CheckFinalTx (*wtx.tx ))
759
759
continue ;
@@ -821,7 +821,7 @@ static UniValue getreceivedbylabel(const JSONRPCRequest& request)
821
821
822
822
// Tally
823
823
CAmount nAmount = 0 ;
824
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
824
+ for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
825
825
const CWalletTx& wtx = pairWtx.second ;
826
826
if (wtx.IsCoinBase () || !CheckFinalTx (*wtx.tx ))
827
827
continue ;
@@ -1534,7 +1534,7 @@ static UniValue ListReceived(CWallet * const pwallet, const UniValue& params, bo
1534
1534
1535
1535
// Tally
1536
1536
std::map<CTxDestination, tallyitem> mapTally;
1537
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
1537
+ for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
1538
1538
const CWalletTx& wtx = pairWtx.second ;
1539
1539
1540
1540
if (wtx.IsCoinBase () || !CheckFinalTx (*wtx.tx ))
@@ -2113,13 +2113,13 @@ static UniValue listaccounts(const JSONRPCRequest& request)
2113
2113
includeWatchonly = includeWatchonly | ISMINE_WATCH_ONLY;
2114
2114
2115
2115
std::map<std::string, CAmount> mapAccountBalances;
2116
- for (const std::pair<CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook ) {
2116
+ for (const std::pair<const CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook ) {
2117
2117
if (IsMine (*pwallet, entry.first ) & includeWatchonly) { // This address belongs to me
2118
2118
mapAccountBalances[entry.second .name ] = 0 ;
2119
2119
}
2120
2120
}
2121
2121
2122
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
2122
+ for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
2123
2123
const CWalletTx& wtx = pairWtx.second ;
2124
2124
CAmount nFee;
2125
2125
std::string strSentAccount;
@@ -2148,7 +2148,7 @@ static UniValue listaccounts(const JSONRPCRequest& request)
2148
2148
mapAccountBalances[entry.strAccount ] += entry.nCreditDebit ;
2149
2149
2150
2150
UniValue ret (UniValue::VOBJ);
2151
- for (const std::pair<std::string, CAmount>& accountBalance : mapAccountBalances) {
2151
+ for (const std::pair<const std::string, CAmount>& accountBalance : mapAccountBalances) {
2152
2152
ret.pushKV (accountBalance.first , ValueFromAmount (accountBalance.second ));
2153
2153
}
2154
2154
return ret;
@@ -2257,7 +2257,7 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
2257
2257
2258
2258
UniValue transactions (UniValue::VARR);
2259
2259
2260
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
2260
+ for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
2261
2261
CWalletTx tx = pairWtx.second ;
2262
2262
2263
2263
if (depth == -1 || tx.GetDepthInMainChain () < depth) {
@@ -4194,7 +4194,7 @@ static UniValue getaddressesbylabel(const JSONRPCRequest& request)
4194
4194
4195
4195
// Find all addresses that have the given label
4196
4196
UniValue ret (UniValue::VOBJ);
4197
- for (const std::pair<CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook ) {
4197
+ for (const std::pair<const CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook ) {
4198
4198
if (item.second .name == label) {
4199
4199
ret.pushKV (EncodeDestination (item.first ), AddressBookDataToJSON (item.second , false ));
4200
4200
}
@@ -4247,7 +4247,7 @@ static UniValue listlabels(const JSONRPCRequest& request)
4247
4247
4248
4248
// Add to a set to sort by label name, then insert into Univalue array
4249
4249
std::set<std::string> label_set;
4250
- for (const std::pair<CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook ) {
4250
+ for (const std::pair<const CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook ) {
4251
4251
if (purpose.empty () || entry.second .purpose == purpose) {
4252
4252
label_set.insert (entry.second .name );
4253
4253
}
0 commit comments