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

Function bitcoin_tx_with_psbt

bitcoin/tx.c:537–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535}
536
537struct bitcoin_tx *bitcoin_tx_with_psbt(const tal_t *ctx, struct wally_psbt *psbt STEALS)
538{
539 struct bitcoin_tx *tx = bitcoin_tx(ctx, chainparams,
540 psbt->tx->num_inputs,
541 psbt->tx->num_outputs,
542 psbt->tx->locktime);
543 wally_tx_free(tx->wtx);
544
545 psbt_finalize(psbt);
546 tx->wtx = psbt_final_tx(tx, psbt);
547 if (!tx->wtx) {
548 tal_wally_start();
549 if (wally_tx_clone_alloc(psbt->tx, 0, &tx->wtx) != WALLY_OK)
550 tx->wtx = NULL;
551 tal_wally_end_onto(tx, tx->wtx, struct wally_tx);
552 if (!tx->wtx)
553 return tal_free(tx);
554 }
555
556 tal_free(tx->psbt);
557 tx->psbt = tal_steal(tx, psbt);
558
559 return tx;
560}
561
562static struct wally_tx *pull_wtx(const tal_t *ctx,
563 const u8 **cursor,

Callers 3

new_inflightFunction · 0.85
db_col_psbt_to_txFunction · 0.85

Calls 5

tal_wally_startFunction · 0.85
tal_freeFunction · 0.85
bitcoin_txFunction · 0.70
psbt_finalizeFunction · 0.70
psbt_final_txFunction · 0.70

Tested by

no test coverage detected