mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user