BOLT #4: * An _intermediate hop_ MUST NOT, but the _final node_: *... * - if it returns a `channel_update`: * - MUST set `short_channel_id` to the `short_channel_id` used * by the incoming onion. */ So, if the scid doesn't match (redirect or we chose an equivalent * channel), we simply don't return an update. */
| 1321 | /* So, if the scid doesn't match (redirect or we chose an equivalent |
| 1322 | * channel), we simply don't return an update. */ |
| 1323 | const u8 *channel_update_for_error(const tal_t *ctx, |
| 1324 | const struct htlc_in *hin, |
| 1325 | struct channel *channel) |
| 1326 | { |
| 1327 | if (!hin || !hin->payload || !hin->payload->forward_channel) |
| 1328 | return NULL; |
| 1329 | |
| 1330 | /* We shouldn't have forwarded to the channel if it wasn't |
| 1331 | * allowed to use that scid, so we can keep it simple here. */ |
| 1332 | if ((!channel->alias[LOCAL] |
| 1333 | || !short_channel_id_eq(*hin->payload->forward_channel, *channel->alias[LOCAL])) |
| 1334 | && (!channel->scid |
| 1335 | || !short_channel_id_eq(*hin->payload->forward_channel, *channel->scid))) { |
| 1336 | return NULL; |
| 1337 | } |
| 1338 | |
| 1339 | return channel_gossip_update_for_error(ctx, channel); |
| 1340 | } |
| 1341 |
no test coverage detected