Skip to content

Commit 749ae12

Browse files
committed
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.
1 parent 5c89d01 commit 749ae12

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lightning/src/util/config.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,17 @@ pub struct UserConfig {
552552
/// [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
553553
/// [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
554554
pub accept_intercept_htlcs: bool,
555+
/// If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
556+
/// parts. If this is set to true, we'll accept the payment.
557+
///
558+
/// Setting this to true will break backwards compatibility upon downgrading to an LDK
559+
/// version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
560+
/// keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
561+
///
562+
/// Default value: false.
563+
///
564+
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
565+
pub accept_mpp_keysend: bool,
555566
}
556567

557568
impl Default for UserConfig {
@@ -564,6 +575,7 @@ impl Default for UserConfig {
564575
accept_inbound_channels: true,
565576
manually_accept_inbound_channels: false,
566577
accept_intercept_htlcs: false,
578+
accept_mpp_keysend: false,
567579
}
568580
}
569581
}

0 commit comments

Comments
 (0)