mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Fix AddressBook syncrhonization between a CWallet and CWalletDB
This problem was reported independently by laanwj in Issue #350.
This commit is contained in:
@@ -977,6 +977,24 @@ bool CWallet::LoadWallet(bool& fFirstRunRet)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CWallet::SetAddressBookName(const string& strAddress, const string& strName)
|
||||
{
|
||||
mapAddressBook[strAddress] = strName;
|
||||
if (!fFileBacked)
|
||||
return false;
|
||||
return CWalletDB(strWalletFile).WriteName(strAddress, strName);
|
||||
}
|
||||
|
||||
bool CWallet::DelAddressBookName(const string& strAddress)
|
||||
{
|
||||
mapAddressBook.erase(strAddress);
|
||||
if (!fFileBacked)
|
||||
return false;
|
||||
return CWalletDB(strWalletFile).EraseName(strAddress);
|
||||
}
|
||||
|
||||
|
||||
void CWallet::PrintWallet(const CBlock& block)
|
||||
{
|
||||
CRITICAL_BLOCK(cs_mapWallet)
|
||||
|
||||
Reference in New Issue
Block a user