26 for (
size_t i = 0; i <
psbtx.tx->vin.size(); ++i) {
35 if (
psbtx.GetInputUTXO(utxo, i)) {
38 "PSBT is not valid. Input %u has invalid value", i));
52 "PSBT is not valid. Input %u spends unspendable output", i));
74 if (
outdata.missing_pubkeys.empty() &&
75 outdata.missing_redeem_script.IsNull() &&
76 !
outdata.missing_sigs.empty()) {
84 }
else if (!utxo.
IsNull()) {
91 for (
size_t i = 0; i <
psbtx.tx->vin.size(); ++i) {
100 std::accumulate(
psbtx.tx->vout.begin(),
psbtx.tx->vout.end(),
102 if (!MoneyRange(a) || !MoneyRange(b.nValue) ||
103 !MoneyRange(a + b.nValue)) {
106 return a +=
b.nValue;
110 strprintf(
"PSBT is not valid. Output amount invalid"));
124 for (
size_t i = 0; i <
psbtx.tx->vin.size(); ++i) {
142 size_t size =
ctx.GetTotalSize();
bool MoneyRange(const Amount nValue)
CCoinsView that adds a memory cache for transactions to another CCoinsView.
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.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
const SigningProvider & DUMMY_SIGNING_PROVIDER
static constexpr Amount zero() noexcept
A version of CTransaction with the PSBT format.
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.