From de8bb07a6581844ffe7903f49a3be76560262300 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 15 Apr 2022 17:13:54 +0000 Subject: [PATCH] Clarify how to encode `channel_update` messages in onions Apparently not all implementations implemented the onion encoding the same, causing vastly differing onion failure packets. This should unify them somewhat. CC https://github.com/ElementsProject/lightning/issues/5154 --- 04-onion-routing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/04-onion-routing.md b/04-onion-routing.md index f498bd6..306bc5f 100644 --- a/04-onion-routing.md +++ b/04-onion-routing.md @@ -853,7 +853,8 @@ The top byte of `failure_code` can be read as a set of flags: * 0x1000 (UPDATE): new channel update enclosed Please note that the `channel_update` field is mandatory in messages whose -`failure_code` includes the `UPDATE` flag. +`failure_code` includes the `UPDATE` flag. It is encoded *with* the message +type prefix, i.e. it will always start with `0x0102`. The following `failure_code`s are defined: