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

Function bitcoin_tx_input_weight

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

Input weight */

Source from the content-addressed store, hash-verified

851
852/* Input weight */
853size_t bitcoin_tx_input_weight(bool p2sh, size_t witness_weight)
854{
855 size_t weight = witness_weight;
856
857 /* Input weight: txid + index + sequence */
858 weight += (32 + 4 + 4) * 4;
859
860 /* We always encode the length of the script, even if empty */
861 weight += 1 * 4;
862
863 /* P2SH variants include push of <0 <20-byte-key-hash>> */
864 if (p2sh)
865 weight += 23 * 4;
866
867 /* Elements inputs have 6 bytes of blank proofs attached. */
868 if (chainparams->is_elements)
869 weight += 6;
870
871 return weight;
872}
873
874size_t bitcoin_tx_simple_input_witness_weight(void)
875{

Callers 4

trim_maximum_feerateFunction · 0.85
utxo_spend_weightFunction · 0.85
listfunds_successFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected