Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | |||||
//! Default for -changetype | //! Default for -changetype | ||||
constexpr OutputType DEFAULT_CHANGE_TYPE{OutputType::CHANGE_AUTO}; | constexpr OutputType DEFAULT_CHANGE_TYPE{OutputType::CHANGE_AUTO}; | ||||
enum WalletFlags : uint64_t { | enum WalletFlags : uint64_t { | ||||
// Wallet flags in the upper section (> 1 << 31) will lead to not opening | // Wallet flags in the upper section (> 1 << 31) will lead to not opening | ||||
// the wallet if flag is unknown. | // the wallet if flag is unknown. | ||||
// Unknown wallet flags in the lower section <= (1 << 31) will be tolerated. | // Unknown wallet flags in the lower section <= (1 << 31) will be tolerated. | ||||
// will categorize coins as clean (not reused) and dirty (reused), and | |||||
// handle | |||||
// them with privacy considerations in mind | |||||
WALLET_FLAG_AVOID_REUSE = (1ULL << 0), | |||||
// Indicates that the metadata has already been upgraded to contain key | // Indicates that the metadata has already been upgraded to contain key | ||||
// origins | // origins | ||||
WALLET_FLAG_KEY_ORIGIN_METADATA = (1ULL << 1), | WALLET_FLAG_KEY_ORIGIN_METADATA = (1ULL << 1), | ||||
// Will enforce the rule that the wallet can't contain any private keys | // Will enforce the rule that the wallet can't contain any private keys | ||||
// (only watch-only/pubkeys). | // (only watch-only/pubkeys). | ||||
WALLET_FLAG_DISABLE_PRIVATE_KEYS = (1ULL << 32), | WALLET_FLAG_DISABLE_PRIVATE_KEYS = (1ULL << 32), | ||||
//! Flag set when a wallet contains no HD seed and no private keys, scripts, | //! Flag set when a wallet contains no HD seed and no private keys, scripts, | ||||
//! addresses, and other watch only things, and is therefore "blank." | //! addresses, and other watch only things, and is therefore "blank." | ||||
//! | //! | ||||
//! The only function this flag serves is to distinguish a blank wallet from | //! The only function this flag serves is to distinguish a blank wallet from | ||||
//! a newly created wallet when the wallet database is loaded, to avoid | //! a newly created wallet when the wallet database is loaded, to avoid | ||||
//! initialization that should only happen on first run. | //! initialization that should only happen on first run. | ||||
//! | //! | ||||
//! This flag is also a mandatory flag to prevent previous versions of | //! This flag is also a mandatory flag to prevent previous versions of | ||||
//! bitcoin from opening the wallet, thinking it was newly created, and | //! bitcoin from opening the wallet, thinking it was newly created, and | ||||
//! then improperly reinitializing it. | //! then improperly reinitializing it. | ||||
WALLET_FLAG_BLANK_WALLET = (1ULL << 33), | WALLET_FLAG_BLANK_WALLET = (1ULL << 33), | ||||
}; | }; | ||||
static constexpr uint64_t KNOWN_WALLET_FLAGS = | static constexpr uint64_t KNOWN_WALLET_FLAGS = | ||||
WALLET_FLAG_DISABLE_PRIVATE_KEYS | WALLET_FLAG_BLANK_WALLET | | WALLET_FLAG_AVOID_REUSE | WALLET_FLAG_BLANK_WALLET | | ||||
WALLET_FLAG_KEY_ORIGIN_METADATA; | WALLET_FLAG_KEY_ORIGIN_METADATA | WALLET_FLAG_DISABLE_PRIVATE_KEYS; | ||||
static const std::map<std::string, WalletFlags> WALLET_FLAG_MAP{ | |||||
{"avoid_reuse", WALLET_FLAG_AVOID_REUSE}, | |||||
{"blank", WALLET_FLAG_BLANK_WALLET}, | |||||
{"key_origin_metadata", WALLET_FLAG_KEY_ORIGIN_METADATA}, | |||||
{"disable_private_keys", WALLET_FLAG_DISABLE_PRIVATE_KEYS}, | |||||
}; | |||||
extern const std::map<uint64_t, std::string> WALLET_FLAG_CAVEATS; | |||||
/** | /** | ||||
* A key from a CWallet's keypool | * A key from a CWallet's keypool | ||||
* | * | ||||
* The wallet holds one (for pre HD-split wallets) or several keypools. These | * The wallet holds one (for pre HD-split wallets) or several keypools. These | ||||
* are sets of keys that have not yet been used to provide addresses or receive | * are sets of keys that have not yet been used to provide addresses or receive | ||||
* change. | * change. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 1,442 Lines • Show Last 20 Lines |