mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Wallet: Require usage of new CAddressBookData::setLabel to change label
This commit is contained in:
@@ -3193,7 +3193,7 @@ bool CWallet::SetAddressBookWithDB(WalletBatch& batch, const CTxDestination& add
|
||||
LOCK(cs_wallet);
|
||||
std::map<CTxDestination, CAddressBookData>::iterator mi = m_address_book.find(address);
|
||||
fUpdated = mi != m_address_book.end();
|
||||
m_address_book[address].name = strName;
|
||||
m_address_book[address].SetLabel(strName);
|
||||
if (!strPurpose.empty()) /* update purpose only if requested */
|
||||
m_address_book[address].purpose = strPurpose;
|
||||
}
|
||||
|
||||
@@ -181,14 +181,20 @@ public:
|
||||
/** Address book data */
|
||||
class CAddressBookData
|
||||
{
|
||||
private:
|
||||
std::string m_label;
|
||||
public:
|
||||
std::string name;
|
||||
const std::string& name;
|
||||
std::string purpose;
|
||||
|
||||
CAddressBookData() : purpose("unknown") {}
|
||||
CAddressBookData() : name(m_label), purpose("unknown") {}
|
||||
|
||||
typedef std::map<std::string, std::string> StringMap;
|
||||
StringMap destdata;
|
||||
|
||||
void SetLabel(const std::string& label) {
|
||||
m_label = label;
|
||||
}
|
||||
};
|
||||
|
||||
struct CRecipient
|
||||
|
||||
@@ -206,7 +206,9 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
|
||||
if (strType == DBKeys::NAME) {
|
||||
std::string strAddress;
|
||||
ssKey >> strAddress;
|
||||
ssValue >> pwallet->m_address_book[DecodeDestination(strAddress)].name;
|
||||
std::string label;
|
||||
ssValue >> label;
|
||||
pwallet->m_address_book[DecodeDestination(strAddress)].SetLabel(label);
|
||||
} else if (strType == DBKeys::PURPOSE) {
|
||||
std::string strAddress;
|
||||
ssKey >> strAddress;
|
||||
|
||||
Reference in New Issue
Block a user