Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | public: | ||||
void ReturnDestination(); | void ReturnDestination(); | ||||
//! Keep the address. Do not return it's key to the keypool when this object | //! Keep the address. Do not return it's key to the keypool when this object | ||||
//! goes out of scope | //! goes out of scope | ||||
void KeepDestination(); | void KeepDestination(); | ||||
}; | }; | ||||
/** Address book data */ | /** Address book data */ | ||||
class CAddressBookData { | class CAddressBookData { | ||||
private: | |||||
bool m_change{true}; | |||||
std::string m_label; | |||||
public: | public: | ||||
std::string name; | const std::string &name; | ||||
std::string purpose; | std::string purpose; | ||||
CAddressBookData() : purpose("unknown") {} | CAddressBookData() : name(m_label), purpose("unknown") {} | ||||
typedef std::map<std::string, std::string> StringMap; | typedef std::map<std::string, std::string> StringMap; | ||||
StringMap destdata; | StringMap destdata; | ||||
bool IsChange() const { return m_change; } | |||||
void SetLabel(const std::string &label) { | |||||
m_change = false; | |||||
m_label = label; | |||||
} | |||||
}; | }; | ||||
struct CRecipient { | struct CRecipient { | ||||
CScript scriptPubKey; | CScript scriptPubKey; | ||||
Amount nAmount; | Amount nAmount; | ||||
bool fSubtractFeeFromAmount; | bool fSubtractFeeFromAmount; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 644 Lines • ▼ Show 20 Lines | public: | ||||
typedef std::multimap<int64_t, CWalletTx *> TxItems; | typedef std::multimap<int64_t, CWalletTx *> TxItems; | ||||
TxItems wtxOrdered; | TxItems wtxOrdered; | ||||
int64_t nOrderPosNext GUARDED_BY(cs_wallet) = 0; | int64_t nOrderPosNext GUARDED_BY(cs_wallet) = 0; | ||||
uint64_t nAccountingEntryNumber = 0; | uint64_t nAccountingEntryNumber = 0; | ||||
std::map<CTxDestination, CAddressBookData> | std::map<CTxDestination, CAddressBookData> | ||||
mapAddressBook GUARDED_BY(cs_wallet); | m_address_book GUARDED_BY(cs_wallet); | ||||
const CAddressBookData * | |||||
FindAddressBookEntry(const CTxDestination &, | |||||
bool allow_change = false) const | |||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
std::set<COutPoint> setLockedCoins GUARDED_BY(cs_wallet); | std::set<COutPoint> setLockedCoins GUARDED_BY(cs_wallet); | ||||
/** Registered interfaces::Chain::Notifications handler. */ | /** Registered interfaces::Chain::Notifications handler. */ | ||||
std::unique_ptr<interfaces::Handler> m_chain_notifications_handler; | std::unique_ptr<interfaces::Handler> m_chain_notifications_handler; | ||||
/** Interface for accessing chain state. */ | /** Interface for accessing chain state. */ | ||||
interfaces::Chain &chain() const { | interfaces::Chain &chain() const { | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | public: | ||||
bool LoadMinVersion(int nVersion) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | bool LoadMinVersion(int nVersion) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
nWalletVersion = nVersion; | nWalletVersion = nVersion; | ||||
nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); | nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); | ||||
return true; | 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, | bool AddDestData(WalletBatch &batch, const CTxDestination &dest, | ||||
const std::string &key, const std::string &value) | const std::string &key, const std::string &value) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | 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, | bool EraseDestData(WalletBatch &batch, const CTxDestination &dest, | ||||
const std::string &key) | const std::string &key) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
//! Adds a destination data tuple to the store, without saving it to disk | //! Adds a destination data tuple to the store, without saving it to disk | ||||
▲ Show 20 Lines • Show All 503 Lines • Show Last 20 Lines |