24 result.
inputs.resize(psbtx.
tx->vin.size());
26 for (
size_t i = 0; i < psbtx.
tx->vin.size(); ++i) {
38 "PSBT is not valid. Input %u has invalid value", i));
52 "PSBT is not valid. Input %u spends unspendable output", i));
84 }
else if (!utxo.
IsNull()) {
91 for (
size_t i = 0; i < psbtx.
tx->vin.size(); ++i) {
93 result.
next = std::min(result.
next, input_analysis.
next);
100 std::accumulate(psbtx.
tx->vout.begin(), psbtx.
tx->vout.end(),
102 if (!MoneyRange(a) || !MoneyRange(b.nValue) ||
103 !MoneyRange(a + b.nValue)) {
110 strprintf(
"PSBT is not valid. Output amount invalid"));
115 Amount fee = in_amt - out_amt;
124 for (
size_t i = 0; i < psbtx.
tx->vin.size(); ++i) {
135 view.
AddCoin(psbtx.
tx->vin[i].prevout,
Coin(newUtxo, 1,
false),
142 size_t size =
ctx.GetTotalSize();
bool MoneyRange(const Amount nValue)
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: Amount / kB.
A mutable version of CTransaction.
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.
Signature hash type wrapper class.
PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
Provides helpful miscellaneous information about where a PSBT is in the signing workflow.
bool PSBTInputSigned(const PSBTInput &input)
Checks whether a PSBTInput is already signed.
bool SignPSBTInput(const SigningProvider &provider, PartiallySignedTransaction &psbt, int index, SigHashType sighash, SignatureData *out_sigdata, bool use_dummy)
Signs a PSBTInput, verifying that all provided data matches what is being signed.
const SigningProvider & DUMMY_SIGNING_PROVIDER
static constexpr Amount zero() noexcept
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.
std::vector< CKeyID > missing_pubkeys
KeyIDs of pubkeys which could not be found.
Holds the results of AnalyzePSBT (miscellaneous information about a PSBT)
std::vector< PSBTInputAnalysis > inputs
More information about the individual inputs of the transaction.
void SetInvalid(std::string err_msg)
std::optional< Amount > fee
Amount of fee being paid by the transaction.
std::optional< size_t > estimated_vsize
Estimated weight of the transaction.
std::optional< CFeeRate > estimated_feerate
Estimated feerate (fee / weight) of the transaction.
PSBTRole next
Which of the BIP 174 roles needs to handle the transaction next.