mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
Wallet: Add warning comments and assert to CWallet::DelAddressBook
This commit is contained in:
parent
6d2905f57a
commit
b5795a7886
2 changed files with 9 additions and 1 deletions
|
@ -3213,6 +3213,11 @@ bool CWallet::SetAddressBook(const CTxDestination& address, const std::string& s
|
||||||
|
|
||||||
bool CWallet::DelAddressBook(const CTxDestination& address)
|
bool CWallet::DelAddressBook(const CTxDestination& address)
|
||||||
{
|
{
|
||||||
|
// If we want to delete receiving addresses, we need to take care that DestData "used" (and possibly newer DestData) gets preserved (and the "deleted" address transformed into a change entry instead of actually being deleted)
|
||||||
|
// NOTE: This isn't a problem for sending addresses because they never have any DestData yet!
|
||||||
|
// When adding new DestData, it should be considered here whether to retain or delete it (or move it?).
|
||||||
|
assert(!IsMine(address));
|
||||||
|
|
||||||
{
|
{
|
||||||
LOCK(cs_wallet);
|
LOCK(cs_wallet);
|
||||||
|
|
||||||
|
|
|
@ -852,7 +852,10 @@ public:
|
||||||
|
|
||||||
bool LoadMinVersion(int nVersion) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { AssertLockHeld(cs_wallet); nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; }
|
bool LoadMinVersion(int nVersion) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { AssertLockHeld(cs_wallet); nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; }
|
||||||
|
|
||||||
//! Adds a destination data tuple to the store, and saves it to disk
|
/**
|
||||||
|
* Adds a destination data tuple to the store, and saves it to disk
|
||||||
|
* When adding new fields, take care to consider how DelAddressBook should handle it!
|
||||||
|
*/
|
||||||
bool AddDestData(WalletBatch& batch, const CTxDestination& dest, const std::string& key, const std::string& value) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
bool AddDestData(WalletBatch& batch, const CTxDestination& dest, const std::string& key, const std::string& value) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
//! Erases a destination data tuple in the store and on disk
|
//! Erases a destination data tuple in the store and on disk
|
||||||
bool EraseDestData(WalletBatch& batch, const CTxDestination& dest, const std::string& key) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
bool EraseDestData(WalletBatch& batch, const CTxDestination& dest, const std::string& key) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
|
|
Loading…
Add table
Reference in a new issue