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

Function pull_wtx

bitcoin/tx.c:605–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605static struct wally_tx *pull_wtx(const tal_t *ctx,
606 const u8 **cursor,
607 size_t *max)
608{
609 int flags = WALLY_TX_FLAG_USE_WITNESS;
610 struct wally_tx *wtx;
611
612 if (chainparams->is_elements)
613 flags |= WALLY_TX_FLAG_USE_ELEMENTS;
614
615 tal_wally_start();
616 if (wally_tx_from_bytes(*cursor, *max, flags, &wtx) != WALLY_OK) {
617 fromwire_fail(cursor, max);
618 wtx = tal_free(wtx);
619 }
620 tal_wally_end_onto(ctx, wtx, struct wally_tx);
621
622 if (wtx) {
623 size_t wsize;
624 wally_tx_get_length(wtx, flags, &wsize);
625 *cursor += wsize;
626 *max -= wsize;
627 }
628
629 return wtx;
630}
631
632struct bitcoin_tx *pull_bitcoin_tx_only(const tal_t *ctx, const u8 **cursor,
633 size_t *max)

Callers 1

pull_bitcoin_tx_onlyFunction · 0.85

Calls 3

tal_wally_startFunction · 0.85
tal_freeFunction · 0.85
fromwire_failFunction · 0.50

Tested by

no test coverage detected