Input weight */
| 851 | |
| 852 | /* Input weight */ |
| 853 | size_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 | |
| 874 | size_t bitcoin_tx_simple_input_witness_weight(void) |
| 875 | { |
no outgoing calls
no test coverage detected