From 618855133d4ae4ece130aec3b35c5a65bea95b8f Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 15 Jul 2013 15:20:50 +1000 Subject: Refactor: CAddressBookData for mapAddressBook Straight refactor, so mapAddressBook stores a CAddressBookData (which just contains a std::string) instead of a std::string. Preparation for payment protocol work, which will add the notion of refund addresses to the address book. --- src/wallet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/wallet.cpp') diff --git a/src/wallet.cpp b/src/wallet.cpp index 8b9f3d34e..4f3516953 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -717,8 +717,8 @@ void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nReceived, { if (pwallet->mapAddressBook.count(r.first)) { - map::const_iterator mi = pwallet->mapAddressBook.find(r.first); - if (mi != pwallet->mapAddressBook.end() && (*mi).second == strAccount) + map::const_iterator mi = pwallet->mapAddressBook.find(r.first); + if (mi != pwallet->mapAddressBook.end() && (*mi).second.name == strAccount) nReceived += r.second; } else if (strAccount.empty()) @@ -1459,8 +1459,8 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet) bool CWallet::SetAddressBookName(const CTxDestination& address, const string& strName) { - std::map::iterator mi = mapAddressBook.find(address); - mapAddressBook[address] = strName; + std::map::iterator mi = mapAddressBook.find(address); + mapAddressBook[address].name = strName; NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address), (mi == mapAddressBook.end()) ? CT_NEW : CT_UPDATED); if (!fFileBacked) return false; -- cgit v1.2.3