Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show All 31 Lines | |||||
#include <vector> | #include <vector> | ||||
bool AddWallet(CWallet *wallet); | bool AddWallet(CWallet *wallet); | ||||
bool RemoveWallet(CWallet *wallet); | bool RemoveWallet(CWallet *wallet); | ||||
bool HasWallets(); | bool HasWallets(); | ||||
std::vector<CWallet *> GetWallets(); | std::vector<CWallet *> GetWallets(); | ||||
CWallet *GetWallet(const std::string &name); | CWallet *GetWallet(const std::string &name); | ||||
//! Default for -keypool | |||||
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000; | static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000; | ||||
//! -paytxfee default | //! -paytxfee default | ||||
constexpr Amount DEFAULT_PAY_TX_FEE = Amount::zero(); | constexpr Amount DEFAULT_PAY_TX_FEE = Amount::zero(); | ||||
//! -fallbackfee default | //! -fallbackfee default | ||||
static const Amount DEFAULT_FALLBACK_FEE(20000 * SATOSHI); | static const Amount DEFAULT_FALLBACK_FEE(20000 * SATOSHI); | ||||
//! -mintxfee default | //! -mintxfee default | ||||
static const Amount DEFAULT_TRANSACTION_MINFEE_PER_KB = 1000 * SATOSHI; | static const Amount DEFAULT_TRANSACTION_MINFEE_PER_KB = 1000 * SATOSHI; | ||||
//! minimum recommended increment for BIP 125 replacement txs | //! minimum recommended increment for BIP 125 replacement txs | ||||
Show All 40 Lines | enum WalletFeature { | ||||
// HD is optional, use FEATURE_COMPRPUBKEY as latest version | // HD is optional, use FEATURE_COMPRPUBKEY as latest version | ||||
FEATURE_LATEST = FEATURE_COMPRPUBKEY, | FEATURE_LATEST = FEATURE_COMPRPUBKEY, | ||||
}; | }; | ||||
enum class OutputType { | enum class OutputType { | ||||
NONE, | NONE, | ||||
LEGACY, | LEGACY, | ||||
DEFAULT = LEGACY, | |||||
}; | }; | ||||
extern OutputType g_address_type; | //! Default for -addresstype | ||||
extern OutputType g_change_type; | constexpr OutputType DEFAULT_ADDRESS_TYPE{OutputType::LEGACY}; | ||||
/** A key pool entry */ | /** A key pool entry */ | ||||
class CKeyPool { | class CKeyPool { | ||||
public: | public: | ||||
int64_t nTime; | int64_t nTime; | ||||
CPubKey vchPubKey; | CPubKey vchPubKey; | ||||
bool fInternal; // for change outputs | bool fInternal; // for change outputs | ||||
▲ Show 20 Lines • Show All 952 Lines • ▼ Show 20 Lines | public: | ||||
// Override with -mintxfee | // Override with -mintxfee | ||||
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}; | |||||
// Default to OutputType::NONE if not set by -changetype | |||||
OutputType m_default_change_type{OutputType::NONE}; | |||||
bool NewKeyPool(); | bool NewKeyPool(); | ||||
size_t KeypoolCountExternalKeys(); | size_t KeypoolCountExternalKeys(); | ||||
bool TopUpKeyPool(unsigned int kpSize = 0); | bool TopUpKeyPool(unsigned int kpSize = 0); | ||||
void ReserveKeyFromKeyPool(int64_t &nIndex, CKeyPool &keypool, | void ReserveKeyFromKeyPool(int64_t &nIndex, CKeyPool &keypool, | ||||
bool fRequestedInternal); | bool fRequestedInternal); | ||||
void KeepKey(int64_t nIndex); | void KeepKey(int64_t nIndex); | ||||
void ReturnKey(int64_t nIndex, bool fInternal, const CPubKey &pubkey); | void ReturnKey(int64_t nIndex, bool fInternal, const CPubKey &pubkey); | ||||
▲ Show 20 Lines • Show All 239 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 ParseOutputType(const std::string &str, OutputType default_type); | ||||
OutputType default_type = OutputType::DEFAULT); | |||||
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 |