Skip to content

Commit

Permalink
Fix warnings related to iterator types
Browse files Browse the repository at this point in the history
  • Loading branch information
gwillen committed May 3, 2019
1 parent 7744877 commit 33fe9b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3113,7 +3113,7 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
std::map<std::string, UniValue> kvMap;
options["changeAddress"].getObjMap(kvMap);

for (const std::pair<std::string, UniValue>& kv : kvMap) {
for (const auto& kv : kvMap) {
CAsset asset = GetAssetFromString(kv.first);
if (asset.IsNull()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "changeAddress key must be a valid asset label or hex");
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2932,7 +2932,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CTransac

mapScriptChange.clear();
if (coin_control.destChange.size() > 0) {
for (const std::pair<CAsset, CTxDestination>& dest : coin_control.destChange) {
for (const auto& dest : coin_control.destChange) {
// No need to test we cover all assets. We produce error for that later.
mapScriptChange[dest.first] = std::pair<int, CScript>(-1, GetScriptForDestination(dest.second));
}
Expand Down Expand Up @@ -3463,7 +3463,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CTransac
}

// Release any change keys that we didn't use.
for (const std::pair<CAsset, std::pair<int, CScript>>& it : mapScriptChange) {
for (const auto& it : mapScriptChange) {
int index = it.second.first;
if (index < 0) {
continue;
Expand Down

0 comments on commit 33fe9b4

Please sign in to comment.