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

Function psbt_input_weight

openingd/dualopend.c:534–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534static size_t psbt_input_weight(struct wally_psbt *psbt,
535 size_t in)
536{
537 size_t weight;
538
539 /* txid + txout + sequence */
540 weight = (32 + 4 + 4) * 4;
541 weight +=
542 (psbt->inputs[in].redeem_script_len +
543 (varint_t) varint_size(psbt->inputs[in].redeem_script_len)) * 4;
544
545 /* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #3:
546 *
547 * The minimum witness weight for an input is 110.
548 */
549 weight += 110;
550 return weight;
551}
552
553static size_t psbt_output_weight(struct wally_psbt *psbt,
554 size_t outnum)

Callers 1

check_balancesFunction · 0.85

Calls 1

varint_sizeFunction · 0.85

Tested by

no test coverage detected