| 164 | } |
| 165 | |
| 166 | static struct failed_htlc *mk_failed_htlc(const tal_t *ctx, |
| 167 | const struct htlc_in *hin, |
| 168 | const struct onionreply *failonion) |
| 169 | { |
| 170 | struct failed_htlc *f = tal(ctx, struct failed_htlc); |
| 171 | |
| 172 | /* Inside a blinded path, override return */ |
| 173 | if (blind_error_return(hin)) { |
| 174 | struct sha256 sha; |
| 175 | sha256(&sha, hin->onion_routing_packet, |
| 176 | sizeof(hin->onion_routing_packet)); |
| 177 | failonion = create_onionreply(tmpctx, hin->shared_secret, |
| 178 | towire_invalid_onion_blinding(tmpctx, &sha)); |
| 179 | } |
| 180 | |
| 181 | f->id = hin->key.id; |
| 182 | f->sha256_of_onion = NULL; |
| 183 | f->badonion = 0; |
| 184 | /* Wrap onion error */ |
| 185 | f->onion = wrap_onionreply(f, hin->shared_secret, failonion); |
| 186 | |
| 187 | return f; |
| 188 | } |
| 189 | |
| 190 | static struct failed_htlc *mk_failed_htlc_badonion(const tal_t *ctx, |
| 191 | const struct htlc_in *hin, |
no test coverage detected