| 129 | } |
| 130 | |
| 131 | void towire_failed_htlc(u8 **pptr, const struct failed_htlc *failed) |
| 132 | { |
| 133 | towire_u64(pptr, failed->id); |
| 134 | /* Only one can be set. */ |
| 135 | if (failed->sha256_of_onion) { |
| 136 | assert(!failed->onion); |
| 137 | assert(failed->badonion & BADONION); |
| 138 | towire_u16(pptr, failed->badonion); |
| 139 | towire_sha256(pptr, failed->sha256_of_onion); |
| 140 | } else { |
| 141 | towire_u16(pptr, 0); |
| 142 | towire_onionreply(pptr, failed->onion); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | static void towire_htlc_state(u8 **pptr, const enum htlc_state hstate) |
| 147 | { |
no test coverage detected