| 28 | } |
| 29 | |
| 30 | struct utxo *fromwire_utxo(const tal_t *ctx, const u8 **ptr, size_t *max) |
| 31 | { |
| 32 | struct utxo *utxo = tal(ctx, struct utxo); |
| 33 | |
| 34 | fromwire_bitcoin_outpoint(ptr, max, &utxo->outpoint); |
| 35 | utxo->amount = fromwire_amount_sat(ptr, max); |
| 36 | utxo->keyindex = fromwire_u32(ptr, max); |
| 37 | utxo->is_p2sh = fromwire_bool(ptr, max); |
| 38 | |
| 39 | utxo->scriptPubkey = fromwire_tal_arrn(utxo, ptr, max, fromwire_u16(ptr, max)); |
| 40 | |
| 41 | if (fromwire_bool(ptr, max)) { |
| 42 | utxo->close_info = tal(utxo, struct unilateral_close_info); |
| 43 | utxo->close_info->channel_id = fromwire_u64(ptr, max); |
| 44 | fromwire_node_id(ptr, max, &utxo->close_info->peer_id); |
| 45 | if (fromwire_bool(ptr, max)) { |
| 46 | utxo->close_info->commitment_point = tal(utxo, |
| 47 | struct pubkey); |
| 48 | fromwire_pubkey(ptr, max, |
| 49 | utxo->close_info->commitment_point); |
| 50 | } else |
| 51 | utxo->close_info->commitment_point = NULL; |
| 52 | utxo->close_info->option_anchor_outputs |
| 53 | = fromwire_bool(ptr, max); |
| 54 | utxo->close_info->csv = fromwire_u32(ptr, max); |
| 55 | } else { |
| 56 | utxo->close_info = NULL; |
| 57 | } |
| 58 | return utxo; |
| 59 | } |
| 60 | |
| 61 | size_t utxo_spend_weight(const struct utxo *utxo, size_t min_witness_weight) |
| 62 | { |
nothing calls this directly
no test coverage detected