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

Function bitcoin_tx_output_weight

bitcoin/tx.c:829–844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829size_t bitcoin_tx_output_weight(size_t outscript_len)
830{
831 size_t weight;
832
833 /* amount, len, scriptpubkey */
834 weight = (8 + varint_size(outscript_len) + outscript_len) * 4;
835
836 if (chainparams->is_elements) {
837 /* Each output additionally has an asset_tag (1 + 32), value
838 * is prefixed by a version (1 byte), an empty nonce (1
839 * byte), two empty proofs (2 bytes). */
840 weight += (32 + 1 + 1 + 1) * 4;
841 }
842
843 return weight;
844}
845
846/* We grind signatures to get them down to 71 bytes */
847size_t bitcoin_tx_input_sig_weight(void)

Callers 10

trim_maximum_feerateFunction · 0.85
bitcoin_tx_core_weightFunction · 0.85
change_amountFunction · 0.85
finish_psbtFunction · 0.85
param_outputsFunction · 0.85
json_withdrawFunction · 0.85
default_lease_ratesFunction · 0.85
handle_mfc_changeFunction · 0.85
perform_fundpsbtFunction · 0.85
start_mwFunction · 0.85

Calls 1

varint_sizeFunction · 0.85

Tested by

no test coverage detected