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

Function utxo_spend_weight

common/utxo.c:4–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <common/utxo.h>
3
4size_t utxo_spend_weight(const struct utxo *utxo, size_t min_witness_weight)
5{
6 size_t witness_weight;
7 bool p2sh = (utxo->utxotype == UTXO_P2SH_P2WPKH);
8
9 witness_weight = bitcoin_tx_input_witness_weight(utxo->utxotype);
10
11 /* If the min is less than what we'd use for a 'normal' tx,
12 * we return the value with the greater added/calculated */
13 if (witness_weight < min_witness_weight)
14 return bitcoin_tx_input_weight(p2sh,
15 min_witness_weight);
16
17 return bitcoin_tx_input_weight(p2sh, witness_weight);
18}
19
20u32 utxo_is_immature(const struct utxo *utxo, u32 blockheight)
21{

Callers 4

wallet_utxo_boostFunction · 0.85
json_fundpsbtFunction · 0.85
json_addpsbtinputFunction · 0.85
json_utxopsbtFunction · 0.85

Calls 2

bitcoin_tx_input_weightFunction · 0.85

Tested by

no test coverage detected