MCPcopy Create free account
hub / github.com/ElementsProject/lightning / spent_scriptpubkey

Function spent_scriptpubkey

common/psbt_internal.c:347–361  ·  view source on GitHub ↗

Our inputs carry witness_utxo. Peer inputs carry the prevtx in utxo. */

Source from the content-addressed store, hash-verified

345
346/* Our inputs carry witness_utxo. Peer inputs carry the prevtx in utxo. */
347static const u8 *spent_scriptpubkey(const struct wally_psbt_input *in,
348 size_t *script_len)
349{
350 if (in->witness_utxo && in->witness_utxo->script) {
351 *script_len = in->witness_utxo->script_len;
352 return in->witness_utxo->script;
353 }
354 if (in->utxo && in->index < in->utxo->num_outputs
355 && in->utxo->outputs[in->index].script) {
356 *script_len = in->utxo->outputs[in->index].script_len;
357 return in->utxo->outputs[in->index].script;
358 }
359 *script_len = 0;
360 return NULL;
361}
362
363const char *check_tx_signatures_witness(const tal_t *ctx,
364 const struct wally_psbt_input *in,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected