Skip to content

Commit

Permalink
psbt: allow non-witness UTXOs when fetching proof values for checking
Browse files Browse the repository at this point in the history
Elements will provide a non-witness UTXO under some circumstances.
  • Loading branch information
jgriffiths committed Dec 27, 2023
1 parent 2fd4f61 commit c48a80d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/psbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2401,9 +2401,8 @@ static int pull_psbt_input(const struct wally_psbt *psbt,
const uint32_t strict_flags = flags | WALLY_PSBT_PARSE_FLAG_STRICT;
/* Commitment key isn't used for PSET_IN_EXPLICIT_VALUE/ASSET */
const uint64_t unused_key = 0xffffffff;

/* Explicit values are only valid if we have an input witness UTXO */
const struct wally_tx_output *utxo = result->witness_utxo;
/* This works here only for v2+, which is fine since PSET is v2+ */
const struct wally_tx_output *utxo = utxo_from_input(psbt, result);

if (!pset_check_proof(result, utxo, NULL, PSET_FT(PSET_IN_ISSUANCE_VALUE),
PSET_IN_ISSUANCE_VALUE_COMMITMENT,
Expand Down

0 comments on commit c48a80d

Please sign in to comment.