struct utxo *fromwire_utxo(const tal_t *ctx, const u8 **ptr, size_t *max) { struct utxo *utxo = tal(ctx, struct utxo); fromwire_bitcoin_txid(ptr, max, &utxo->txid); utxo->outnum = fromwire_u32(ptr, max); utxo->amount = fromwire_u64(ptr, max); utxo->keyindex = fromwire_u32(ptr, max); utxo->is_p2sh = fromwire_bool(ptr, max); if (fromwire_bool(ptr, max)) { utxo->close_info = tal(utxo, struct unilateral_close_info); utxo->close_info->channel_id = fromwire_u64(ptr, max); fromwire_pubkey(ptr, max, &utxo->close_info->peer_id); fromwire_pubkey(ptr, max, &utxo->close_info->commitment_point); } else {
void fromwire_added_htlc(const u8 **cursor, size_t *max, struct added_htlc *added) { added->id = fromwire_u64(cursor, max); added->amount = fromwire_amount_msat(cursor, max); fromwire_sha256(cursor, max, &added->payment_hash); added->cltv_expiry = fromwire_u32(cursor, max); fromwire(cursor, max, added->onion_routing_packet, sizeof(added->onion_routing_packet)); }