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

Function pull_wtx

bitcoin/tx.c:562–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562static struct wally_tx *pull_wtx(const tal_t *ctx,
563 const u8 **cursor,
564 size_t *max)
565{
566 int flags = WALLY_TX_FLAG_USE_WITNESS;
567 struct wally_tx *wtx;
568
569 if (chainparams->is_elements)
570 flags |= WALLY_TX_FLAG_USE_ELEMENTS;
571
572 tal_wally_start();
573 if (wally_tx_from_bytes(*cursor, *max, flags, &wtx) != WALLY_OK) {
574 fromwire_fail(cursor, max);
575 wtx = tal_free(wtx);
576 }
577 tal_wally_end_onto(ctx, wtx, struct wally_tx);
578
579 if (wtx) {
580 size_t wsize;
581 wally_tx_get_length(wtx, flags, &wsize);
582 *cursor += wsize;
583 *max -= wsize;
584 }
585
586 return wtx;
587}
588
589struct bitcoin_tx *pull_bitcoin_tx(const tal_t *ctx, const u8 **cursor,
590 size_t *max)

Callers 1

pull_bitcoin_txFunction · 0.85

Calls 3

tal_wally_startFunction · 0.85
tal_freeFunction · 0.85
fromwire_failFunction · 0.50

Tested by

no test coverage detected