Skip to content

Commit c48a80d

Browse files
committed
psbt: allow non-witness UTXOs when fetching proof values for checking
Elements will provide a non-witness UTXO under some circumstances.
1 parent 2fd4f61 commit c48a80d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/psbt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,9 +2401,8 @@ static int pull_psbt_input(const struct wally_psbt *psbt,
24012401
const uint32_t strict_flags = flags | WALLY_PSBT_PARSE_FLAG_STRICT;
24022402
/* Commitment key isn't used for PSET_IN_EXPLICIT_VALUE/ASSET */
24032403
const uint64_t unused_key = 0xffffffff;
2404-
2405-
/* Explicit values are only valid if we have an input witness UTXO */
2406-
const struct wally_tx_output *utxo = result->witness_utxo;
2404+
/* This works here only for v2+, which is fine since PSET is v2+ */
2405+
const struct wally_tx_output *utxo = utxo_from_input(psbt, result);
24072406

24082407
if (!pset_check_proof(result, utxo, NULL, PSET_FT(PSET_IN_ISSUANCE_VALUE),
24092408
PSET_IN_ISSUANCE_VALUE_COMMITMENT,

0 commit comments

Comments
 (0)