Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 406 Lines • ▼ Show 20 Lines | if (IsMine(*pwallet, dest)) { | ||||
pwallet->SetAddressBook(dest, label, "send"); | pwallet->SetAddressBook(dest, label, "send"); | ||||
} | } | ||||
// Detect when there are no addresses using this label. | // Detect when there are no addresses using this label. | ||||
// If so, delete the account record for it. Labels, unlike addresses, can be | // If so, delete the account record for it. Labels, unlike addresses, can be | ||||
// deleted, and if we wouldn't do this, the record would stick around | // deleted, and if we wouldn't do this, the record would stick around | ||||
// forever. | // forever. | ||||
bool found_address = false; | bool found_address = false; | ||||
for (const std::pair<CTxDestination, CAddressBookData> &item : | for (const std::pair<const CTxDestination, CAddressBookData> &item : | ||||
pwallet->mapAddressBook) { | pwallet->mapAddressBook) { | ||||
if (item.second.name == label) { | if (item.second.name == label) { | ||||
found_address = true; | found_address = true; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if (!found_address) { | if (!found_address) { | ||||
pwallet->DeleteLabel(old_label); | pwallet->DeleteLabel(old_label); | ||||
▲ Show 20 Lines • Show All 5,036 Lines • Show Last 20 Lines |