| 239 | } |
| 240 | |
| 241 | struct failed_htlc *fromwire_failed_htlc(const tal_t *ctx, const u8 **cursor, size_t *max) |
| 242 | { |
| 243 | struct failed_htlc *failed = tal(ctx, struct failed_htlc); |
| 244 | enum onion_wire badonion; |
| 245 | |
| 246 | failed->id = fromwire_u64(cursor, max); |
| 247 | badonion = fromwire_u16(cursor, max); |
| 248 | if (badonion) { |
| 249 | failed->onion = NULL; |
| 250 | if (!(badonion & BADONION)) |
| 251 | return tal_free(failed); |
| 252 | failed->badonion = badonion; |
| 253 | failed->sha256_of_onion = tal(failed, struct sha256); |
| 254 | fromwire_sha256(cursor, max, failed->sha256_of_onion); |
| 255 | } else { |
| 256 | failed->sha256_of_onion = NULL; |
| 257 | failed->onion = fromwire_onionreply(failed, cursor, max); |
| 258 | } |
| 259 | |
| 260 | return failed; |
| 261 | } |
| 262 | |
| 263 | static enum htlc_state fromwire_htlc_state(const u8 **cursor, size_t *max) |
| 264 | { |
no test coverage detected