| 280 | } |
| 281 | |
| 282 | struct failed_htlc *fromwire_failed_htlc(const tal_t *ctx, const u8 **cursor, size_t *max) |
| 283 | { |
| 284 | struct failed_htlc *failed = tal(ctx, struct failed_htlc); |
| 285 | enum onion_wire badonion; |
| 286 | |
| 287 | failed->id = fromwire_u64(cursor, max); |
| 288 | badonion = fromwire_u16(cursor, max); |
| 289 | if (badonion) { |
| 290 | failed->onion = NULL; |
| 291 | if (!(badonion & BADONION)) |
| 292 | return tal_free(failed); |
| 293 | failed->badonion = badonion; |
| 294 | failed->sha256_of_onion = tal(failed, struct sha256); |
| 295 | fromwire_sha256(cursor, max, failed->sha256_of_onion); |
| 296 | } else { |
| 297 | failed->sha256_of_onion = NULL; |
| 298 | failed->onion = fromwire_onionreply(failed, cursor, max); |
| 299 | } |
| 300 | |
| 301 | return failed; |
| 302 | } |
| 303 | |
| 304 | static enum htlc_state fromwire_htlc_state(const u8 **cursor, size_t *max) |
| 305 | { |
no test coverage detected