Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | enum WalletFeature { | ||||
// Upgraded to HD SPLIT and can have a pre-split keypool | // Upgraded to HD SPLIT and can have a pre-split keypool | ||||
FEATURE_PRE_SPLIT_KEYPOOL = 200300, | FEATURE_PRE_SPLIT_KEYPOOL = 200300, | ||||
FEATURE_LATEST = FEATURE_PRE_SPLIT_KEYPOOL, | FEATURE_LATEST = FEATURE_PRE_SPLIT_KEYPOOL, | ||||
}; | }; | ||||
enum class OutputType { | enum class OutputType { | ||||
NONE, | |||||
LEGACY, | LEGACY, | ||||
/** | |||||
* Special output type for change outputs only. Automatically choose type | |||||
* based on address type setting and the types other of non-change outputs | |||||
* (see -changetype option documentation and implementation in | |||||
* CWallet::TransactionChangeType for details). | |||||
*/ | |||||
CHANGE_AUTO, | |||||
}; | }; | ||||
//! Default for -addresstype | //! Default for -addresstype | ||||
constexpr OutputType DEFAULT_ADDRESS_TYPE{OutputType::LEGACY}; | constexpr OutputType DEFAULT_ADDRESS_TYPE{OutputType::LEGACY}; | ||||
//! Default for -changetype | |||||
constexpr OutputType DEFAULT_CHANGE_TYPE{OutputType::CHANGE_AUTO}; | |||||
/** A key pool entry */ | /** A key pool entry */ | ||||
class CKeyPool { | class CKeyPool { | ||||
public: | public: | ||||
int64_t nTime; | int64_t nTime; | ||||
CPubKey vchPubKey; | CPubKey vchPubKey; | ||||
// for change outputs | // for change outputs | ||||
bool fInternal; | bool fInternal; | ||||
// For keys generated before keypool split upgrade | // For keys generated before keypool split upgrade | ||||
▲ Show 20 Lines • Show All 997 Lines • ▼ Show 20 Lines | public: | ||||
CFeeRate m_min_fee{DEFAULT_TRANSACTION_MINFEE_PER_KB}; | CFeeRate m_min_fee{DEFAULT_TRANSACTION_MINFEE_PER_KB}; | ||||
/** | /** | ||||
* If fee estimation does not have enough data to provide estimates, use | * If fee estimation does not have enough data to provide estimates, use | ||||
* this fee instead. Has no effect if not using fee estimation Override with | * this fee instead. Has no effect if not using fee estimation Override with | ||||
* -fallbackfee | * -fallbackfee | ||||
*/ | */ | ||||
CFeeRate m_fallback_fee{DEFAULT_FALLBACK_FEE}; | CFeeRate m_fallback_fee{DEFAULT_FALLBACK_FEE}; | ||||
OutputType m_default_address_type{DEFAULT_ADDRESS_TYPE}; | OutputType m_default_address_type{DEFAULT_ADDRESS_TYPE}; | ||||
// Default to OutputType::NONE if not set by -changetype | OutputType m_default_change_type{DEFAULT_CHANGE_TYPE}; | ||||
OutputType m_default_change_type{OutputType::NONE}; | |||||
bool NewKeyPool(); | bool NewKeyPool(); | ||||
size_t KeypoolCountExternalKeys() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | size_t KeypoolCountExternalKeys() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
bool TopUpKeyPool(unsigned int kpSize = 0); | bool TopUpKeyPool(unsigned int kpSize = 0); | ||||
/** | /** | ||||
* Reserves a key from the keypool and sets nIndex to its index | * Reserves a key from the keypool and sets nIndex to its index | ||||
* | * | ||||
▲ Show 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
if (!(s.GetType() & SER_GETHASH)) { | if (!(s.GetType() & SER_GETHASH)) { | ||||
READWRITE(nVersion); | READWRITE(nVersion); | ||||
} | } | ||||
READWRITE(vchPubKey); | READWRITE(vchPubKey); | ||||
} | } | ||||
}; | }; | ||||
OutputType ParseOutputType(const std::string &str, OutputType default_type); | bool ParseOutputType(const std::string &str, OutputType &output_type); | ||||
const std::string &FormatOutputType(OutputType type); | const std::string &FormatOutputType(OutputType type); | ||||
/** | /** | ||||
* Get a destination of the requested type (if possible) to the specified key. | * Get a destination of the requested type (if possible) to the specified key. | ||||
* The caller must make sure LearnRelatedScripts has been called beforehand. | * The caller must make sure LearnRelatedScripts has been called beforehand. | ||||
*/ | */ | ||||
CTxDestination GetDestinationForKey(const CPubKey &key, OutputType); | CTxDestination GetDestinationForKey(const CPubKey &key, OutputType); | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |