Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Namespaces | Functions
spend.h File Reference
#include <consensus/amount.h>
#include <policy/fees.h>
#include <util/result.h>
#include <wallet/coinselection.h>
#include <wallet/transaction.h>
#include <wallet/wallet.h>
#include <optional>
Include dependency graph for spend.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wallet::TxSize
 
struct  wallet::CoinsResult
 COutputs available for spending, stored by OutputType. More...
 
struct  wallet::CoinFilterParams
 
struct  wallet::SelectionFilter
 
struct  wallet::PreSelectedInputs
 
struct  wallet::CreatedTransactionResult
 

Namespaces

namespace  wallet
 

Functions

int wallet::CalculateMaximumSignedInputSize (const CTxOut &txout, const CWallet *pwallet, const CCoinControl *coin_control)
 Get the marginal bytes if spending the specified output from this transaction. More...
 
int wallet::CalculateMaximumSignedInputSize (const CTxOut &txout, const COutPoint outpoint, const SigningProvider *provider, bool can_grind_r, const CCoinControl *coin_control)
 
TxSize wallet::CalculateMaximumSignedTxSize (const CTransaction &tx, const CWallet *wallet, const std::vector< CTxOut > &txouts, const CCoinControl *coin_control=nullptr)
 Calculate the size of the transaction using CoinControl to determine whether to expect signature grinding when calculating the size of the input spend. More...
 
TxSize wallet::CalculateMaximumSignedTxSize (const CTransaction &tx, const CWallet *wallet, const CCoinControl *coin_control)
 
CoinsResult wallet::AvailableCoins (const CWallet &wallet, const CCoinControl *coinControl=nullptr, std::optional< CFeeRate > feerate=std::nullopt, const CoinFilterParams &params={}) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 Populate the CoinsResult struct with vectors of available COutputs, organized by OutputType. More...
 
CoinsResult wallet::AvailableCoinsListUnspent (const CWallet &wallet, const CCoinControl *coinControl=nullptr, CoinFilterParams params={}) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 Wrapper function for AvailableCoins which skips the feerate and CoinFilterParams::only_spendable parameters. More...
 
const CTxOutwallet::FindNonChangeParentOutput (const CWallet &wallet, const COutPoint &outpoint) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 Find non-change parent output. More...
 
std::map< CTxDestination, std::vector< COutput > > wallet::ListCoins (const CWallet &wallet) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 Return list of available coins and locked coins grouped by non-change output address. More...
 
FilteredOutputGroups wallet::GroupOutputs (const CWallet &wallet, const CoinsResult &coins, const CoinSelectionParams &coin_sel_params, const std::vector< SelectionFilter > &filters)
 Group coins by the provided filters. More...
 
util::Result< SelectionResult > wallet::AttemptSelection (interfaces::Chain &chain, const CAmount &nTargetValue, OutputGroupTypeMap &groups, const CoinSelectionParams &coin_selection_params, bool allow_mixed_output_types)
 Attempt to find a valid input set that preserves privacy by not mixing OutputTypes. More...
 
util::Result< SelectionResult > wallet::ChooseSelectionResult (interfaces::Chain &chain, const CAmount &nTargetValue, Groups &groups, const CoinSelectionParams &coin_selection_params)
 Attempt to find a valid input set that meets the provided eligibility filter and target. More...
 
util::Result< PreSelectedInputs > wallet::FetchSelectedInputs (const CWallet &wallet, const CCoinControl &coin_control, const CoinSelectionParams &coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 Fetch and validate coin control selected inputs. More...
 
util::Result< SelectionResult > wallet::AutomaticCoinSelection (const CWallet &wallet, CoinsResult &available_coins, const CAmount &nTargetValue, const CoinSelectionParams &coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 Select a set of coins such that nTargetValue is met; never select unconfirmed coins if they are not ours param@[in] wallet The wallet which provides data necessary to spend the selected coins param@[in] available_coins The struct of coins, organized by OutputType, available for selection prior to filtering param@[in] nTargetValue The target value param@[in] coin_selection_params Parameters for this coin selection such as feerates, whether to avoid partial spends, and whether to subtract the fee from the outputs. More...
 
util::Result< SelectionResult > wallet::SelectCoins (const CWallet &wallet, CoinsResult &available_coins, const PreSelectedInputs &pre_set_inputs, const CAmount &nTargetValue, const CCoinControl &coin_control, const CoinSelectionParams &coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 Select all coins from coin_control, and if coin_control 'm_allow_other_inputs=true', call 'AutomaticCoinSelection' to select a set of coins such that nTargetValue - pre_set_inputs.total_amount is met. More...
 
util::Result< CreatedTransactionResult > wallet::CreateTransaction (CWallet &wallet, const std::vector< CRecipient > &vecSend, std::optional< unsigned int > change_pos, const CCoinControl &coin_control, bool sign=true)
 Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also create the change output, when needed. More...
 
util::Result< CreatedTransactionResult > wallet::FundTransaction (CWallet &wallet, const CMutableTransaction &tx, const std::vector< CRecipient > &recipients, std::optional< unsigned int > change_pos, bool lockUnspents, CCoinControl)
 Insert additional inputs into the transaction by calling CreateTransaction();. More...