24 result.
inputs.resize(psbtx.
tx->vin.size());
28 for (
unsigned int i = 0; i < psbtx.
tx->vin.size(); ++i) {
84 }
else if (!utxo.
IsNull()){
91 for (
unsigned int i = 0; i < psbtx.
tx->vin.size(); ++i) {
93 result.
next = std::min(result.
next, input_analysis.
next);
99 CAmount out_amt = std::accumulate(psbtx.
tx->vout.begin(), psbtx.
tx->vout.end(),
CAmount(0),
113 CAmount fee = in_amt - out_amt;
122 for (
unsigned int i = 0; i < psbtx.
tx->vin.size(); ++i) {
133 view.
AddCoin(psbtx.
tx->vin[i].prevout, std::move(newcoin),
true);
bool MoneyRange(const CAmount &nValue)
int64_t CAmount
Amount in satoshis (Can be negative)
CCoinsView that adds a memory cache for transactions to another CCoinsView.
void AddCoin(const COutPoint &outpoint, Coin &&coin, bool possible_overwrite)
Add a coin.
Abstract view on the open txout dataset.
Fee rate in satoshis per kilobyte: CAmount / kB.
bool IsUnspendable() const
Returns whether the script is guaranteed to fail at execution, regardless of the initial stack.
The basic transaction that is broadcasted on the network and contained in blocks.
An output of a transaction.
CTxOut out
unspent transaction output
uint32_t nHeight
at which height this containing transaction was included in the active block chain
PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
Provides helpful miscellaneous information about where a PSBT is in the signing workflow.
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
static constexpr unsigned int STANDARD_SCRIPT_VERIFY_FLAGS
Standard script verification flags that standard transactions will comply with.
bool SignPSBTInput(const SigningProvider &provider, PartiallySignedTransaction &psbt, int index, const PrecomputedTransactionData *txdata, int sighash, SignatureData *out_sigdata)
Signs a PSBTInput, verifying that all provided data matches what is being signed.
bool PSBTInputSigned(const PSBTInput &input)
Checks whether a PSBTInput is already signed.
PrecomputedTransactionData PrecomputePSBTData(const PartiallySignedTransaction &psbt)
Compute a PrecomputedTransactionData object from a psbt.
const SigningProvider & DUMMY_SIGNING_PROVIDER
A mutable version of CTransaction.
Holds the results of AnalyzePSBT (miscellaneous information about a PSBT)
std::optional< size_t > estimated_vsize
Estimated weight of the transaction.
std::optional< CAmount > fee
Amount of fee being paid by the transaction.
std::vector< PSBTInputAnalysis > inputs
More information about the individual inputs of the transaction.
std::optional< CFeeRate > estimated_feerate
Estimated feerate (fee / weight) of the transaction.
void SetInvalid(std::string err_msg)
PSBTRole next
Which of the BIP 174 roles needs to handle the transaction next.
A version of CTransaction with the PSBT format.
bool GetInputUTXO(CTxOut &utxo, int input_index) const
Finds the UTXO for a given input index.
std::vector< PSBTInput > inputs
std::optional< CMutableTransaction > tx
uint160 missing_redeem_script
ScriptID of the missing redeemScript (if any)
std::vector< CKeyID > missing_sigs
KeyIDs of pubkeys for signatures which could not be found.
uint256 missing_witness_script
SHA256 of the missing witnessScript (if any)
std::vector< CKeyID > missing_pubkeys
KeyIDs of pubkeys which could not be found.
static secp256k1_context * ctx
int64_t GetTransactionSigOpCost(const CTransaction &tx, const CCoinsViewCache &inputs, uint32_t flags)
Compute total signature operation cost of a transaction.