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