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

Function fromwire_bitcoin_tx

bitcoin/tx.c:714–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712}
713
714struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx,
715 const u8 **cursor, size_t *max)
716{
717 struct bitcoin_tx *tx;
718
719 u32 len = fromwire_u32(cursor, max);
720 size_t start = *max;
721 tx = pull_bitcoin_tx(ctx, cursor, max);
722 if (!tx)
723 return fromwire_fail(cursor, max);
724 // Check that we consumed len bytes
725 if (start - *max != len)
726 return fromwire_fail(cursor, max);
727
728 /* pull_bitcoin_tx sets the psbt */
729 tal_free(tx->psbt);
730 tx->psbt = fromwire_wally_psbt(tx, cursor, max);
731 if (!tx->psbt)
732 return fromwire_fail(cursor, max);
733
734 return tx;
735}
736
737void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid)
738{

Callers

nothing calls this directly

Calls 5

pull_bitcoin_txFunction · 0.85
tal_freeFunction · 0.85
fromwire_wally_psbtFunction · 0.70
fromwire_u32Function · 0.50
fromwire_failFunction · 0.50

Tested by

no test coverage detected