Immediately fail HTLC with a BADONION code */
| 172 | |
| 173 | /* Immediately fail HTLC with a BADONION code */ |
| 174 | static void local_fail_in_htlc_badonion(struct htlc_in *hin, |
| 175 | enum onion_wire badonion) |
| 176 | { |
| 177 | struct failed_htlc *failed_htlc; |
| 178 | assert(!hin->preimage); |
| 179 | |
| 180 | assert(badonion & BADONION); |
| 181 | hin->badonion = badonion; |
| 182 | /* We update state now to signal it's in progress, for persistence. */ |
| 183 | htlc_in_update_state(hin->key.channel, hin, SENT_REMOVE_HTLC); |
| 184 | htlc_in_check(hin, __func__); |
| 185 | |
| 186 | failed_htlc = mk_failed_htlc_badonion(tmpctx, hin, badonion); |
| 187 | tell_channeld_htlc_failed(hin, failed_htlc); |
| 188 | } |
| 189 | |
| 190 | /* This is used for cases where we can immediately fail the HTLC. */ |
| 191 | void local_fail_in_htlc(struct htlc_in *hin, const u8 *failmsg TAKES) |
no test coverage detected