diff options
| author | Jeff Garzik <[email protected]> | 2011-07-02 16:46:07 -0400 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2011-07-02 16:46:07 -0400 |
| commit | a76899624ab4987dab7ca81d5ed22af140482d42 (patch) | |
| tree | 6a36c5573151f4a6e5bba7c39e4e05380ded8a02 /src/wallet.cpp | |
| parent | Merge pull request #374 from TheBlueMatt/neterror (diff) | |
| parent | Fix AddressBook syncrhonization between a CWallet and CWalletDB (diff) | |
| download | discoin-a76899624ab4987dab7ca81d5ed22af140482d42.tar.xz discoin-a76899624ab4987dab7ca81d5ed22af140482d42.zip | |
Merge branch 'tmp2' into tmp3
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index e35bce61e..e54bbb3f4 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -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) |