@@ -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 ;
@@ -1527,7 +1527,7 @@ static UniValue ListReceived(CWallet * const pwallet, const UniValue& params, bo
1527
1527
1528
1528
// Tally
1529
1529
std::map<CTxDestination, tallyitem> mapTally;
1530
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
1530
+ for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
1531
1531
const CWalletTx& wtx = pairWtx.second ;
1532
1532
1533
1533
if (wtx.IsCoinBase () || !CheckFinalTx (*wtx.tx ))
@@ -2106,13 +2106,13 @@ static UniValue listaccounts(const JSONRPCRequest& request)
2106
2106
includeWatchonly = includeWatchonly | ISMINE_WATCH_ONLY;
2107
2107
2108
2108
std::map<std::string, CAmount> mapAccountBalances;
2109
- for (const std::pair<CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook ) {
2109
+ for (const std::pair<const CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook ) {
2110
2110
if (IsMine (*pwallet, entry.first ) & includeWatchonly) { // This address belongs to me
2111
2111
mapAccountBalances[entry.second .name ] = 0 ;
2112
2112
}
2113
2113
}
2114
2114
2115
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
2115
+ for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
2116
2116
const CWalletTx& wtx = pairWtx.second ;
2117
2117
CAmount nFee;
2118
2118
std::string strSentAccount;
@@ -2141,7 +2141,7 @@ static UniValue listaccounts(const JSONRPCRequest& request)
2141
2141
mapAccountBalances[entry.strAccount ] += entry.nCreditDebit ;
2142
2142
2143
2143
UniValue ret (UniValue::VOBJ);
2144
- for (const std::pair<std::string, CAmount>& accountBalance : mapAccountBalances) {
2144
+ for (const std::pair<const std::string, CAmount>& accountBalance : mapAccountBalances) {
2145
2145
ret.pushKV (accountBalance.first , ValueFromAmount (accountBalance.second ));
2146
2146
}
2147
2147
return ret;
@@ -2250,7 +2250,7 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
2250
2250
2251
2251
UniValue transactions (UniValue::VARR);
2252
2252
2253
- for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
2253
+ for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet ) {
2254
2254
CWalletTx tx = pairWtx.second ;
2255
2255
2256
2256
if (depth == -1 || tx.GetDepthInMainChain () < depth) {
@@ -4187,7 +4187,7 @@ static UniValue getaddressesbylabel(const JSONRPCRequest& request)
4187
4187
4188
4188
// Find all addresses that have the given label
4189
4189
UniValue ret (UniValue::VOBJ);
4190
- for (const std::pair<CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook ) {
4190
+ for (const std::pair<const CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook ) {
4191
4191
if (item.second .name == label) {
4192
4192
ret.pushKV (EncodeDestination (item.first ), AddressBookDataToJSON (item.second , false ));
4193
4193
}
@@ -4240,7 +4240,7 @@ static UniValue listlabels(const JSONRPCRequest& request)
4240
4240
4241
4241
// Add to a set to sort by label name, then insert into Univalue array
4242
4242
std::set<std::string> label_set;
4243
- for (const std::pair<CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook ) {
4243
+ for (const std::pair<const CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook ) {
4244
4244
if (purpose.empty () || entry.second .purpose == purpose) {
4245
4245
label_set.insert (entry.second .name );
4246
4246
}
0 commit comments