@@ -4119,7 +4119,7 @@ impl<
41194119 ));
41204120 }
41214121 pending_events.push_back((
4122- events::Event::SpliceFailed {
4122+ events::Event::SpliceNegotiationFailed {
41234123 channel_id: *chan_id,
41244124 counterparty_node_id: *counterparty_node_id,
41254125 user_channel_id: chan.context().get_user_id(),
@@ -4425,7 +4425,7 @@ impl<
44254425 ));
44264426 }
44274427 pending_events.push_back((
4428- events::Event::SpliceFailed {
4428+ events::Event::SpliceNegotiationFailed {
44294429 channel_id: shutdown_res.channel_id,
44304430 counterparty_node_id: shutdown_res.counterparty_node_id,
44314431 user_channel_id: shutdown_res.user_channel_id,
@@ -4931,7 +4931,7 @@ impl<
49314931 ));
49324932 }
49334933 pending_events.push_back((
4934- events::Event::SpliceFailed {
4934+ events::Event::SpliceNegotiationFailed {
49354935 channel_id: *channel_id,
49364936 counterparty_node_id: *counterparty_node_id,
49374937 user_channel_id: chan.context.get_user_id(),
@@ -6619,7 +6619,7 @@ impl<
66196619 ));
66206620 }
66216621 pending_events.push_back((
6622- events::Event::SpliceFailed {
6622+ events::Event::SpliceNegotiationFailed {
66236623 channel_id,
66246624 counterparty_node_id,
66256625 user_channel_id,
@@ -6665,14 +6665,14 @@ impl<
66656665 /// # Events
66666666 ///
66676667 /// Calling this method will commence the process of creating a new funding transaction for the
6668- /// channel. Once the funding transaction has been constructed, an [`Event::SplicePending `]
6668+ /// channel. Once the funding transaction has been constructed, an [`Event::SpliceNegotiated `]
66696669 /// will be emitted. At this point, any inputs contributed to the splice can only be re-spent
66706670 /// if an [`Event::DiscardFunding`] is seen.
66716671 ///
6672- /// If any failures occur while negotiating the funding transaction, an [`Event::SpliceFailed`]
6673- /// will be emitted. Any contributed inputs no longer used will be included in an
6674- /// [`Event::DiscardFunding`] and thus can be re-spent. If a [`FundingTemplate`] was obtained
6675- /// while a previous splice was still being negotiated, its
6672+ /// If any failures occur while negotiating the funding transaction, an
6673+ /// [`Event::SpliceNegotiationFailed`] will be emitted. Any contributed inputs no longer used
6674+ /// will be included in an [`Event::DiscardFunding`] and thus can be re-spent. If a
6675+ /// [`FundingTemplate`] was obtained while a previous splice was still being negotiated, its
66766676 /// [`min_rbf_feerate`][FundingTemplate::min_rbf_feerate] may be stale after the failure.
66776677 /// Call [`ChannelManager::splice_channel`] again to get a fresh template.
66786678 ///
@@ -6891,7 +6891,7 @@ impl<
68916891 }
68926892 if let Some(splice_negotiated) = splice_negotiated {
68936893 self.pending_events.lock().unwrap().push_back((
6894- events::Event::SplicePending {
6894+ events::Event::SpliceNegotiated {
68956895 channel_id: *channel_id,
68966896 counterparty_node_id: *counterparty_node_id,
68976897 user_channel_id: chan.context().get_user_id(),
@@ -10984,7 +10984,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1098410984 .and_then(|v| v.splice_negotiated.take())
1098510985 {
1098610986 pending_events.push_back((
10987- events::Event::SplicePending {
10987+ events::Event::SpliceNegotiated {
1098810988 channel_id: channel.context.channel_id(),
1098910989 counterparty_node_id,
1099010990 user_channel_id: channel.context.get_user_id(),
@@ -11849,7 +11849,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1184911849 ));
1185011850 }
1185111851 pending_events.push_back((
11852- events::Event::SpliceFailed {
11852+ events::Event::SpliceNegotiationFailed {
1185311853 channel_id,
1185411854 counterparty_node_id: *counterparty_node_id,
1185511855 user_channel_id: channel.context().get_user_id(),
@@ -12010,7 +12010,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1201012010 ));
1201112011 }
1201212012 pending_events.push_back((
12013- events::Event::SpliceFailed {
12013+ events::Event::SpliceNegotiationFailed {
1201412014 channel_id: msg.channel_id,
1201512015 counterparty_node_id,
1201612016 user_channel_id: chan.context().get_user_id(),
@@ -12099,7 +12099,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1209912099 let exited_quiescence = splice_negotiated.is_some();
1210012100 if let Some(splice_negotiated) = splice_negotiated {
1210112101 self.pending_events.lock().unwrap().push_back((
12102- events::Event::SplicePending {
12102+ events::Event::SpliceNegotiated {
1210312103 channel_id: msg.channel_id,
1210412104 counterparty_node_id: *counterparty_node_id,
1210512105 user_channel_id: chan.context.get_user_id(),
@@ -12182,7 +12182,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1218212182 ));
1218312183 }
1218412184 pending_events.push_back((
12185- events::Event::SpliceFailed {
12185+ events::Event::SpliceNegotiationFailed {
1218612186 channel_id: msg.channel_id,
1218712187 counterparty_node_id: *counterparty_node_id,
1218812188 user_channel_id: chan_entry.get().context().get_user_id(),
@@ -12334,7 +12334,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1233412334 ));
1233512335 }
1233612336 pending_events.push_back((
12337- events::Event::SpliceFailed {
12337+ events::Event::SpliceNegotiationFailed {
1233812338 channel_id: msg.channel_id,
1233912339 counterparty_node_id: *counterparty_node_id,
1234012340 user_channel_id: chan.context().get_user_id(),
@@ -15167,16 +15167,16 @@ impl<
1516715167 self.process_pending_events(&event_handler);
1516815168 let collected_events = events.into_inner();
1516915169
15170- // When both DiscardFunding and SpliceFailed are emitted for the same channel,
15171- // DiscardFunding must come first so that inputs are unlocked before any retry.
15172- // Each pair is emitted adjacently under a single lock, so checking adjacent
15173- // events is sufficient.
15170+ // When both DiscardFunding and SpliceNegotiationFailed are emitted for the same
15171+ // channel, DiscardFunding must come first so that inputs are unlocked before any
15172+ // retry. Each pair is emitted adjacently under a single lock, so checking
15173+ // adjacent events is sufficient.
1517415174 for window in collected_events.windows(2) {
15175- if let events::Event::SpliceFailed { channel_id, .. } = &window[0] {
15175+ if let events::Event::SpliceNegotiationFailed { channel_id, .. } = &window[0] {
1517615176 if let events::Event::DiscardFunding { channel_id: cid, .. } = &window[1] {
1517715177 assert!(
1517815178 channel_id != cid,
15179- "DiscardFunding must precede SpliceFailed for channel {}",
15179+ "DiscardFunding must precede SpliceNegotiationFailed for channel {}",
1518015180 channel_id,
1518115181 );
1518215182 }
@@ -15463,7 +15463,7 @@ impl<
1546315463 funding_info,
1546415464 });
1546515465 }
15466- splice_failed_events.push(events::Event::SpliceFailed {
15466+ splice_failed_events.push(events::Event::SpliceNegotiationFailed {
1546715467 channel_id: chan.context().channel_id(),
1546815468 counterparty_node_id,
1546915469 user_channel_id: chan.context().get_user_id(),
@@ -18119,8 +18119,9 @@ impl<
1811918119 let our_pending_intercepts = self.pending_intercepted_htlcs.lock().unwrap();
1812018120
1812118121 // Since some FundingNegotiation variants are not persisted, any splice in such state must
18122- // be failed upon reload. However, as the necessary information for the SpliceFailed and
18123- // DiscardFunding events is not persisted, the events need to be persisted even though they
18122+ // be failed upon reload. However, as the necessary information for the
18123+ // SpliceNegotiationFailed and DiscardFunding events is not persisted, the events need to
18124+ // be persisted even though they
1812418125 // haven't been emitted yet. These are removed after the events are written.
1812518126 let mut events = self.pending_events.lock().unwrap();
1812618127 let event_count = events.len();
@@ -18138,7 +18139,7 @@ impl<
1813818139 ));
1813918140 }
1814018141 events.push_back((
18141- events::Event::SpliceFailed {
18142+ events::Event::SpliceNegotiationFailed {
1814218143 channel_id: chan.context.channel_id(),
1814318144 counterparty_node_id: chan.context.get_counterparty_node_id(),
1814418145 user_channel_id: chan.context.get_user_id(),
@@ -18267,7 +18268,7 @@ impl<
1826718268 (23, self.best_block.read().unwrap().previous_blocks, required),
1826818269 });
1826918270
18270- // Remove the SpliceFailed and DiscardFunding events added earlier.
18271+ // Remove the SpliceNegotiationFailed and DiscardFunding events added earlier.
1827118272 events.truncate(event_count);
1827218273
1827318274 Ok(())
0 commit comments