From: Alec Chen Date: Thu, 20 Apr 2023 21:00:47 +0000 (-0500) Subject: Allow user to opt-in to accepting MPP keysend X-Git-Tag: v0.0.116-alpha1~13^2~4 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=749ae12e2230ff2a9d34ec767bdc4623a2649ca7;p=rust-lightning Allow user to opt-in to accepting MPP keysend To support receiving MPP keysends, we will add a new non-backward compatible field to `PendingHTLCRouting::ReceiveKeysend`, which will break deserialization of `ChannelManager` on downgrades, so we allow the user choose whether they want to do this. Note that this commit only adds the config flag, while full MPP support is added in later commits. --- diff --git a/lightning/src/util/config.rs b/lightning/src/util/config.rs index 1e678152c..fef5338ce 100644 --- a/lightning/src/util/config.rs +++ b/lightning/src/util/config.rs @@ -552,6 +552,17 @@ pub struct UserConfig { /// [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid /// [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted pub accept_intercept_htlcs: bool, + /// If this is set to false, when receiving a keysend payment we'll fail it if it has multiple + /// parts. If this is set to true, we'll accept the payment. + /// + /// Setting this to true will break backwards compatibility upon downgrading to an LDK + /// version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP + /// keysend, downgrading will cause us to fail to deserialize [`ChannelManager`]. + /// + /// Default value: false. + /// + /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + pub accept_mpp_keysend: bool, } impl Default for UserConfig { @@ -564,6 +575,7 @@ impl Default for UserConfig { accept_inbound_channels: true, manually_accept_inbound_channels: false, accept_intercept_htlcs: false, + accept_mpp_keysend: false, } } }