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

Function bitcoin_tx_weight

bitcoin/tx.c:467–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467size_t bitcoin_tx_weight(const struct bitcoin_tx *tx)
468{
469 size_t extra;
470 size_t num_witnesses;
471
472 /* If we don't have witnesses *yet*, libwally doesn't encode
473 * in BIP 141 style, omitting the flag and marker bytes */
474 wally_tx_get_witness_count(tx->wtx, &num_witnesses);
475 if (num_witnesses == 0) {
476 if (chainparams->is_elements)
477 extra = 7;
478 else
479 extra = 2;
480 } else
481 extra = 0;
482
483 return extra + wally_tx_weight(tx->wtx);
484}
485
486void wally_txid(const struct wally_tx *wtx, struct bitcoin_txid *txid)
487{

Callers 10

tx_feerateFunction · 0.85
penalty_tx_createFunction · 0.85
send_commit_partFunction · 0.85
onchaind_tx_unsignedFunction · 0.85
create_anchor_detailsFunction · 0.85
spend_anchorFunction · 0.85
send_splice_txFunction · 0.85

Calls 1

wally_tx_weightFunction · 0.85

Tested by

no test coverage detected