Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | |||||
class CScript; | class CScript; | ||||
class CTxMemPool; | class CTxMemPool; | ||||
class CWalletTx; | class CWalletTx; | ||||
class ReserveDestination; | class ReserveDestination; | ||||
//! 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}; | |||||
static constexpr uint64_t KNOWN_WALLET_FLAGS = | static constexpr uint64_t KNOWN_WALLET_FLAGS = | ||||
WALLET_FLAG_AVOID_REUSE | WALLET_FLAG_BLANK_WALLET | | WALLET_FLAG_AVOID_REUSE | WALLET_FLAG_BLANK_WALLET | | ||||
WALLET_FLAG_KEY_ORIGIN_METADATA | WALLET_FLAG_DISABLE_PRIVATE_KEYS | | WALLET_FLAG_KEY_ORIGIN_METADATA | WALLET_FLAG_DISABLE_PRIVATE_KEYS | | ||||
WALLET_FLAG_DESCRIPTORS; | WALLET_FLAG_DESCRIPTORS; | ||||
static constexpr uint64_t MUTABLE_WALLET_FLAGS = WALLET_FLAG_AVOID_REUSE; | static constexpr uint64_t MUTABLE_WALLET_FLAGS = WALLET_FLAG_AVOID_REUSE; | ||||
static const std::map<std::string, WalletFlags> WALLET_FLAG_MAP{ | static const std::map<std::string, WalletFlags> WALLET_FLAG_MAP{ | ||||
▲ Show 20 Lines • Show All 965 Lines • ▼ Show 20 Lines | struct Balance { | ||||
Amount m_mine_immature{Amount::zero()}; | Amount m_mine_immature{Amount::zero()}; | ||||
Amount m_watchonly_trusted{Amount::zero()}; | Amount m_watchonly_trusted{Amount::zero()}; | ||||
Amount m_watchonly_untrusted_pending{Amount::zero()}; | Amount m_watchonly_untrusted_pending{Amount::zero()}; | ||||
Amount m_watchonly_immature{Amount::zero()}; | Amount m_watchonly_immature{Amount::zero()}; | ||||
}; | }; | ||||
Balance GetBalance(int min_depth = 0, bool avoid_reuse = true) const; | Balance GetBalance(int min_depth = 0, bool avoid_reuse = true) const; | ||||
Amount GetAvailableBalance(const CCoinControl *coinControl = nullptr) const; | Amount GetAvailableBalance(const CCoinControl *coinControl = nullptr) const; | ||||
OutputType TransactionChangeType(OutputType change_type, | OutputType | ||||
TransactionChangeType(const std::optional<OutputType> &change_type, | |||||
const std::vector<CRecipient> &vecSend); | const std::vector<CRecipient> &vecSend); | ||||
/** | /** | ||||
* Insert additional inputs into the transaction by calling | * Insert additional inputs into the transaction by calling | ||||
* CreateTransaction(); | * CreateTransaction(); | ||||
*/ | */ | ||||
bool FundTransaction(CMutableTransaction &tx, Amount &nFeeRet, | bool FundTransaction(CMutableTransaction &tx, Amount &nFeeRet, | ||||
int &nChangePosInOut, bilingual_str &error, | int &nChangePosInOut, bilingual_str &error, | ||||
bool lockUnspents, | bool lockUnspents, | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | public: | ||||
* 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}; | ||||
//! note: this is absolute fee, not fee rate | //! note: this is absolute fee, not fee rate | ||||
Amount m_max_aps_fee{DEFAULT_MAX_AVOIDPARTIALSPEND_FEE}; | Amount m_max_aps_fee{DEFAULT_MAX_AVOIDPARTIALSPEND_FEE}; | ||||
OutputType m_default_address_type{DEFAULT_ADDRESS_TYPE}; | OutputType m_default_address_type{DEFAULT_ADDRESS_TYPE}; | ||||
OutputType m_default_change_type{DEFAULT_CHANGE_TYPE}; | /** | ||||
* Default output type for change outputs. When unset, automatically choose | |||||
* type based on address type setting and the types other of non-change | |||||
* outputs (see implementation in CWallet::TransactionChangeType for | |||||
* details). | |||||
*/ | |||||
std::optional<OutputType> m_default_change_type{}; | |||||
/** | /** | ||||
* Absolute maximum transaction fee (in satoshis) used by default for the | * Absolute maximum transaction fee (in satoshis) used by default for the | ||||
* wallet. | * wallet. | ||||
*/ | */ | ||||
Amount m_default_max_tx_fee{DEFAULT_TRANSACTION_MAXFEE}; | Amount m_default_max_tx_fee{DEFAULT_TRANSACTION_MAXFEE}; | ||||
size_t KeypoolCountExternalKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | size_t KeypoolCountExternalKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
bool TopUpKeyPool(unsigned int kpSize = 0); | bool TopUpKeyPool(unsigned int kpSize = 0); | ||||
▲ Show 20 Lines • Show All 391 Lines • Show Last 20 Lines |