Specify why flags for `channel_disabled` error are zero
authorDuncan Dean <duncangleeddean@gmail.com>
Tue, 26 Jul 2022 07:54:09 +0000 (09:54 +0200)
committerDuncan Dean <duncangleeddean@gmail.com>
Tue, 26 Jul 2022 08:29:12 +0000 (10:29 +0200)
We can remove the TODO for this and specify why the flags are zero
as it's now fully specified in BOLT 4.

See https://github.com/lightning/bolts/blob/341ec84/04-onion-routing.md?plain=1#L1008

lightning/src/ln/channelmanager.rs

index 67c7b58e879cac181b31bd9a42e3775aa84d7ed6..d011d6b42c8621314dfd44fe49709bac702b6620 100644 (file)
@@ -3794,7 +3794,8 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
                if let Ok(upd) = self.get_channel_update_for_onion(scid, chan) {
                        let mut enc = VecWriter(Vec::with_capacity(upd.serialized_length() + 6));
                        if desired_err_code == 0x1000 | 20 {
-                               // TODO: underspecified, follow https://github.com/lightning/bolts/issues/791
+                               // No flags for `disabled_flags` are currently defined so they're always two zero bytes.
+                               // See https://github.com/lightning/bolts/blob/341ec84/04-onion-routing.md?plain=1#L1008
                                0u16.write(&mut enc).expect("Writes cannot fail");
                        }
                        (upd.serialized_length() as u16 + 2).write(&mut enc).expect("Writes cannot fail");