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

Function bitcoin_tx_output_weight

bitcoin/tx.c:872–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872size_t bitcoin_tx_output_weight(size_t outscript_len)
873{
874 size_t weight;
875
876 /* amount, len, scriptpubkey */
877 weight = (8 + varint_size(outscript_len) + outscript_len) * 4;
878
879 if (chainparams->is_elements) {
880 /* Each output additionally has an asset_tag (1 + 32), value
881 * is prefixed by a version (1 byte), an empty nonce (1
882 * byte), two empty proofs (2 bytes). */
883 weight += (32 + 1 + 1 + 1) * 4;
884 }
885
886 return weight;
887}
888
889/* We grind signatures to get them down to 71 bytes */
890size_t bitcoin_tx_input_sig_weight(void)

Callers 12

trim_maximum_feerateFunction · 0.85
bitcoin_tx_core_weightFunction · 0.85
change_weightFunction · 0.85
finish_psbtFunction · 0.85
json_addpsbtoutputFunction · 0.85
param_outputsFunction · 0.85
json_withdrawFunction · 0.85
newaddr_sweep_doneFunction · 0.85
default_lease_ratesFunction · 0.85
calc_weightFunction · 0.85
perform_fundpsbtFunction · 0.85
start_mwFunction · 0.85

Calls 1

varint_sizeFunction · 0.85

Tested by

no test coverage detected