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. */
| 1394 | /* So, if the scid doesn't match (redirect or we chose an equivalent |
| 1395 | * channel), we simply don't return an update. */ |
| 1396 | const u8 *channel_update_for_error(const tal_t *ctx, |
| 1397 | const struct htlc_in *hin, |
| 1398 | struct channel *channel) |
| 1399 | { |
| 1400 | if (!hin || !hin->payload || !hin->payload->forward_channel) |
| 1401 | return NULL; |
| 1402 | |
| 1403 | /* We shouldn't have forwarded to the channel if it wasn't |
| 1404 | * allowed to use that scid, so we can keep it simple here. */ |
| 1405 | if ((!channel->alias[LOCAL] |
| 1406 | || !short_channel_id_eq(*hin->payload->forward_channel, *channel->alias[LOCAL])) |
| 1407 | && (!channel->scid |
| 1408 | || !short_channel_id_eq(*hin->payload->forward_channel, *channel->scid))) { |
| 1409 | return NULL; |
| 1410 | } |
| 1411 | |
| 1412 | return channel_gossip_update_for_error(ctx, channel); |
| 1413 | } |
| 1414 |
no test coverage detected