diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 041ba64d2ecda..ed66542a8e9a7 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2890,10 +2890,10 @@ bool CWallet::SetAddressBook(const CTxDestination& address, const std::string& s mapAddressBook[address].purpose = strPurpose; } NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address) != ISMINE_NO, - strPurpose, (fUpdated ? CT_UPDATED : CT_NEW)); + mapAddressBook.at(address).purpose, (fUpdated ? CT_UPDATED : CT_NEW)); if (!fFileBacked) return false; - std::string addressStr = ParseIntoAddress(address, strPurpose).ToString(); + std::string addressStr = ParseIntoAddress(address, mapAddressBook.at(address).purpose).ToString(); if (!strPurpose.empty() && !CWalletDB(strWalletFile).WritePurpose(addressStr, strPurpose)) return false; return CWalletDB(strWalletFile).WriteName(addressStr, strName);