Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 3,846 Lines • ▼ Show 20 Lines | bool CWallet::DelAddressBook(const CTxDestination &address) { | ||||
NotifyAddressBookChanged(this, address, "", | NotifyAddressBookChanged(this, address, "", | ||||
::IsMine(*this, address) != ISMINE_NO, "", | ::IsMine(*this, address) != ISMINE_NO, "", | ||||
CT_DELETED); | CT_DELETED); | ||||
WalletBatch(*database).ErasePurpose(address); | WalletBatch(*database).ErasePurpose(address); | ||||
return WalletBatch(*database).EraseName(address); | return WalletBatch(*database).EraseName(address); | ||||
} | } | ||||
const std::string &CWallet::GetLabelName(const CScript &scriptPubKey) const { | |||||
CTxDestination address; | |||||
if (ExtractDestination(scriptPubKey, address) && | |||||
!scriptPubKey.IsUnspendable()) { | |||||
auto mi = mapAddressBook.find(address); | |||||
if (mi != mapAddressBook.end()) { | |||||
return mi->second.name; | |||||
} | |||||
} | |||||
// A scriptPubKey that doesn't have an entry in the address book is | |||||
// associated with the default label (""). | |||||
const static std::string DEFAULT_LABEL_NAME; | |||||
return DEFAULT_LABEL_NAME; | |||||
} | |||||
/** | /** | ||||
* Mark old keypool keys as used, and generate all new keys. | * Mark old keypool keys as used, and generate all new keys. | ||||
*/ | */ | ||||
bool CWallet::NewKeyPool() { | bool CWallet::NewKeyPool() { | ||||
if (IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) { | if (IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) { | ||||
return false; | return false; | ||||
} | } | ||||
LOCK(cs_wallet); | LOCK(cs_wallet); | ||||
▲ Show 20 Lines • Show All 1,608 Lines • Show Last 20 Lines |