From: Matt Corallo Date: Tue, 31 May 2022 21:30:31 +0000 (+0000) Subject: wip? X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=336dc6b90b994d1d8f5e75dd540dca06b3a4e328;p=rust-lightning wip? --- diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index d488117d..685a7536 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -1084,11 +1084,12 @@ impl Channel { // We currently only allow two channel types, so write it all out here - we allow // `only_static_remote_key` in all contexts, and further allow // `static_remote_key|scid_privacy` if the channel is not publicly announced. - if *channel_type != ChannelTypeFeatures::only_static_remote_key() { - if !channel_type.requires_scid_privacy() && !channel_type.requires_zero_conf() { + let mut allowed_type = ChannelTypeFeatures::only_static_remote_key(); + if *channel_type != allowed_type { + if channel_type.supports_unknown_bits() { return Err(ChannelError::Close("Channel Type was not understood".to_owned())); } - if announced_channel { + if channel_type.supports_scid_privacy() && announced_channel { return Err(ChannelError::Close("SCID Alias/Privacy Channel Type cannot be set on a public channel".to_owned())); } }