| 151 | } |
| 152 | |
| 153 | void towire_failed_htlc(u8 **pptr, const struct failed_htlc *failed) |
| 154 | { |
| 155 | towire_u64(pptr, failed->id); |
| 156 | /* Only one can be set. */ |
| 157 | if (failed->sha256_of_onion) { |
| 158 | assert(!failed->onion); |
| 159 | assert(failed->badonion & BADONION); |
| 160 | towire_u16(pptr, failed->badonion); |
| 161 | towire_sha256(pptr, failed->sha256_of_onion); |
| 162 | } else { |
| 163 | towire_u16(pptr, 0); |
| 164 | towire_onionreply(pptr, failed->onion); |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | static void towire_htlc_state(u8 **pptr, const enum htlc_state hstate) |
| 169 | { |
no test coverage detected