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

Function bitcoin_tx_weight

bitcoin/tx.c:455–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455size_t bitcoin_tx_weight(const struct bitcoin_tx *tx)
456{
457 size_t extra;
458 size_t num_witnesses;
459
460 /* If we don't have witnesses *yet*, libwally doesn't encode
461 * in BIP 141 style, omitting the flag and marker bytes */
462 wally_tx_get_witness_count(tx->wtx, &num_witnesses);
463 if (num_witnesses == 0) {
464 if (chainparams->is_elements)
465 extra = 7;
466 else
467 extra = 2;
468 } else
469 extra = 0;
470
471 return extra + wally_tx_weight(tx->wtx);
472}
473
474void wally_txid(const struct wally_tx *wtx, struct bitcoin_txid *txid)
475{

Callers 6

tx_to_usFunction · 0.85
proposal_should_rbfFunction · 0.85
penalty_tx_createFunction · 0.85
onchaind_funding_spentFunction · 0.85

Calls 1

wally_tx_weightFunction · 0.85

Tested by

no test coverage detected