aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-07-15 15:20:50 +1000
committerGavin Andresen <gavinandresen@gmail.com>2013-08-22 11:05:45 +1000
commit618855133d4ae4ece130aec3b35c5a65bea95b8f (patch)
treefbbaf4bfdf5751ad24635fdcb4b633d71433a2d0 /src/wallet.cpp
parentb94595bb7f6b98c11182df5373fe6461f4776098 (diff)
downloadbitcoin-618855133d4ae4ece130aec3b35c5a65bea95b8f.tar.xz
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.
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 8b9f3d34e1..4f3516953c 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<CTxDestination, string>::const_iterator mi = pwallet->mapAddressBook.find(r.first);
- if (mi != pwallet->mapAddressBook.end() && (*mi).second == strAccount)
+ map<CTxDestination, CAddressBookData>::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<CTxDestination, std::string>::iterator mi = mapAddressBook.find(address);
- mapAddressBook[address] = strName;
+ std::map<CTxDestination, CAddressBookData>::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;