| 191 | } |
| 192 | |
| 193 | struct existing_htlc *fromwire_existing_htlc(const tal_t *ctx, |
| 194 | const u8 **cursor, size_t *max) |
| 195 | { |
| 196 | struct existing_htlc *existing = tal(ctx, struct existing_htlc); |
| 197 | |
| 198 | existing->state = fromwire_u8(cursor, max); |
| 199 | existing->id = fromwire_u64(cursor, max); |
| 200 | existing->amount = fromwire_amount_msat(cursor, max); |
| 201 | fromwire_sha256(cursor, max, &existing->payment_hash); |
| 202 | existing->cltv_expiry = fromwire_u32(cursor, max); |
| 203 | fromwire(cursor, max, existing->onion_routing_packet, |
| 204 | sizeof(existing->onion_routing_packet)); |
| 205 | if (fromwire_bool(cursor, max)) { |
| 206 | existing->payment_preimage = tal(existing, struct preimage); |
| 207 | fromwire_preimage(cursor, max, existing->payment_preimage); |
| 208 | } else |
| 209 | existing->payment_preimage = NULL; |
| 210 | if (fromwire_bool(cursor, max)) |
| 211 | existing->failed = fromwire_failed_htlc(existing, cursor, max); |
| 212 | else |
| 213 | existing->failed = NULL; |
| 214 | if (fromwire_bool(cursor, max)) { |
| 215 | existing->blinding = tal(existing, struct pubkey); |
| 216 | fromwire_pubkey(cursor, max, existing->blinding); |
| 217 | } else |
| 218 | existing->blinding = NULL; |
| 219 | return existing; |
| 220 | } |
| 221 | |
| 222 | struct simple_htlc *fromwire_simple_htlc(const tal_t *ctx, |
| 223 | const u8 **cursor, size_t *max) |
nothing calls this directly
no test coverage detected