 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
5 #ifndef BITCOIN_WALLET_SPEND_H
6 #define BITCOIN_WALLET_SPEND_H
15 int GetTxSpendSize(
const CWallet&
wallet,
const CWalletTx& wtx,
unsigned int out,
bool use_max_sig =
false);
51 COutput(
const CWallet&
wallet,
const CWalletTx& wtx,
int iIn,
int nDepthIn,
bool fSpendableIn,
bool fSolvableIn,
bool fSafeIn,
bool use_max_sig_in =
false)
102 std::vector<OutputGroup>
GroupOutputs(const CWallet&
wallet, const
std::vector<COutput>& outputs, const CoinSelectionParams& coin_sel_params, const CoinEligibilityFilter& filter,
bool positive_only);
117 std::optional<SelectionResult>
AttemptSelection(const CWallet&
wallet, const
CAmount& nTargetValue, const CoinEligibilityFilter& eligibility_filter,
std::vector<COutput> coins,
118 const CoinSelectionParams& coin_selection_params);
131 std::optional<SelectionResult>
SelectCoins(const CWallet&
wallet, const
std::vector<COutput>& vAvailableCoins, const
CAmount& nTargetValue, const CCoinControl& coin_control,
148 #endif // BITCOIN_WALLET_SPEND_H
std::optional< SelectionResult > AttemptSelection(const CWallet &wallet, const CAmount &nTargetValue, const CoinEligibilityFilter &eligibility_filter, std::vector< COutput > coins, const CoinSelectionParams &coin_selection_params)
Attempt to find a valid input set that meets the provided eligibility filter and target.
int CalculateMaximumSignedInputSize(const CTxOut &txout, const SigningProvider *provider, bool use_max_sig)
std::vector< OutputGroup > GroupOutputs(const CWallet &wallet, const std::vector< COutput > &outputs, const CoinSelectionParams &coin_sel_params, const CoinEligibilityFilter &filter, bool positive_only)
const CTxOut & FindNonChangeParentOutput(const CWallet &wallet, const CTransaction &tx, int output)
Find non-change parent output.
An interface to be implemented by keystores that support signing.
CAmount GetAvailableBalance(const CWallet &wallet, const CCoinControl *coinControl)
std::shared_ptr< const CTransaction > CTransactionRef
A transaction with a bunch of additional info that only the owner cares about.
The basic transaction that is broadcasted on the network and contained in blocks.
CInputCoin GetInputCoin() const
bool fSolvable
Whether we know how to spend this output, ignoring the lack of keys.
int nInputBytes
Pre-computed estimated size of this output as a fully-signed input in a transaction.
void AvailableCoins(const CWallet &wallet, std::vector< COutput > &vCoins, const CCoinControl *coinControl, const CAmount &nMinimumAmount, const CAmount &nMaximumAmount, const CAmount &nMinimumSumAmount, const uint64_t nMaximumCount)
populate vCoins with vector of available COutputs.
bool use_max_sig
Whether to use the maximum sized, 72 byte signature when calculating the size of the input spend.
bool fSafe
Whether this output is considered safe to spend.
std::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
An output of a transaction.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
int nDepth
Depth in block chain.
COutput(const CWallet &wallet, const CWalletTx &wtx, int iIn, int nDepthIn, bool fSpendableIn, bool fSolvableIn, bool fSafeIn, bool use_max_sig_in=false)
int64_t CAmount
Amount in satoshis (Can be negative)
void FundTransaction(CWallet &wallet, CMutableTransaction &tx, CAmount &fee_out, int &change_position, const UniValue &options, CCoinControl &coinControl, bool override_min_fee)
bool fSpendable
Whether we have the private keys to spend this output.
bool CreateTransaction(CWallet &wallet, const std::vector< CRecipient > &vecSend, CTransactionRef &tx, CAmount &nFeeRet, int &nChangePosInOut, bilingual_str &error, const CCoinControl &coin_control, FeeCalculation &fee_calc_out, bool sign)
Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also cr...
std::map< CTxDestination, std::vector< COutput > > ListCoins(const CWallet &wallet)
Return list of available coins and locked coins grouped by non-change output address.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
std::optional< SelectionResult > SelectCoins(const CWallet &wallet, const std::vector< COutput > &vAvailableCoins, const CAmount &nTargetValue, const CCoinControl &coin_control, const CoinSelectionParams &coin_selection_params)
Select a set of coins such that nTargetValue is met and at least all coins from coin_control are sele...
static constexpr CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
int GetTxSpendSize(const CWallet &wallet, const CWalletTx &wtx, unsigned int out, bool use_max_sig)
Get the marginal bytes if spending the specified output from this transaction.
bool error(const char *fmt, const Args &... args)
A mutable version of CTransaction.
std::string ToString() const
TxSize CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *wallet, const std::vector< CTxOut > &txouts, const CCoinControl *coin_control)
Calculate the size of the transaction assuming all signatures are max size Use DummySignatureCreator,...