| 240 | } |
| 241 | |
| 242 | struct existing_htlc *fromwire_existing_htlc(const tal_t *ctx, |
| 243 | const u8 **cursor, size_t *max) |
| 244 | { |
| 245 | struct existing_htlc *existing = tal(ctx, struct existing_htlc); |
| 246 | |
| 247 | existing->state = fromwire_u8(cursor, max); |
| 248 | existing->id = fromwire_u64(cursor, max); |
| 249 | existing->amount = fromwire_amount_msat(cursor, max); |
| 250 | fromwire_sha256(cursor, max, &existing->payment_hash); |
| 251 | existing->cltv_expiry = fromwire_u32(cursor, max); |
| 252 | fromwire(cursor, max, existing->onion_routing_packet, |
| 253 | sizeof(existing->onion_routing_packet)); |
| 254 | if (fromwire_bool(cursor, max)) { |
| 255 | existing->payment_preimage = tal(existing, struct preimage); |
| 256 | fromwire_preimage(cursor, max, existing->payment_preimage); |
| 257 | } else |
| 258 | existing->payment_preimage = NULL; |
| 259 | if (fromwire_bool(cursor, max)) |
| 260 | existing->failed = fromwire_failed_htlc(existing, cursor, max); |
| 261 | else |
| 262 | existing->failed = NULL; |
| 263 | if (fromwire_bool(cursor, max)) { |
| 264 | existing->path_key = tal(existing, struct pubkey); |
| 265 | fromwire_pubkey(cursor, max, existing->path_key); |
| 266 | } else |
| 267 | existing->path_key = NULL; |
| 268 | if (fromwire_bool(cursor, max)) { |
| 269 | existing->extra_tlvs = fromwire_len_and_tlvstream(existing, cursor, max); |
| 270 | } else |
| 271 | existing->extra_tlvs = NULL; |
| 272 | return existing; |
| 273 | } |
| 274 | |
| 275 | void fromwire_fulfilled_htlc(const u8 **cursor, size_t *max, |
| 276 | struct fulfilled_htlc *fulfilled) |
nothing calls this directly
no test coverage detected