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

Function fromwire_bitcoin_tx

bitcoin/tx.c:760–779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

758}
759
760struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx,
761 const u8 **cursor, size_t *max)
762{
763 struct bitcoin_tx *tx;
764
765 u32 len = fromwire_u32(cursor, max);
766 size_t start = *max;
767 tx = pull_bitcoin_tx_only(ctx, cursor, max);
768 if (!tx)
769 return fromwire_fail(cursor, max);
770 // Check that we consumed len bytes
771 if (start - *max != len)
772 return fromwire_fail(cursor, max);
773
774 tx->psbt = fromwire_wally_psbt(tx, cursor, max);
775 if (!tx->psbt)
776 return fromwire_fail(cursor, max);
777
778 return tx;
779}
780
781void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid)
782{

Callers 2

mainFunction · 0.85
fromwire_inflightFunction · 0.85

Calls 4

pull_bitcoin_tx_onlyFunction · 0.85
fromwire_wally_psbtFunction · 0.85
fromwire_u32Function · 0.50
fromwire_failFunction · 0.50

Tested by 1

mainFunction · 0.68