Skip to content

Commit 305e81e

Browse files
jkczyzclaude
andcommitted
f - Document stale min_rbf_feerate when in-progress negotiation fails
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e33d2c9 commit 305e81e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lightning/src/ln/channel.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11968,7 +11968,9 @@ where
1196811968
// feerate requirement. Derive the minimum RBF feerate from the negotiation's
1196911969
// feerate so the user can choose an appropriate feerate.
1197011970
// - If the negotiation fails (e.g., tx_abort), the splice will proceed as a fresh
11971-
// splice instead.
11971+
// splice instead. In this case, the min_rbf_feerate becomes stale, causing a
11972+
// slightly higher feerate than necessary. Call splice_channel again after
11973+
// receiving SpliceFailed to get a fresh template without the RBF constraint.
1197211974
let prev_feerate = negotiation.funding_feerate_sat_per_1000_weight();
1197311975
let min_feerate_kwu = ((prev_feerate as u64) * 25).div_ceil(24);
1197411976
(Some(FeeRate::from_sat_per_kwu(min_feerate_kwu)), None)

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6526,7 +6526,10 @@ impl<
65266526
///
65276527
/// If any failures occur while negotiating the funding transaction, an [`Event::SpliceFailed`]
65286528
/// will be emitted. Any contributed inputs no longer used will be included in an
6529-
/// [`Event::DiscardFunding`] and thus can be re-spent.
6529+
/// [`Event::DiscardFunding`] and thus can be re-spent. If a [`FundingTemplate`] was obtained
6530+
/// while a previous splice was still being negotiated, its
6531+
/// [`min_rbf_feerate`][FundingTemplate::min_rbf_feerate] may be stale after the failure.
6532+
/// Call this method again to get a fresh template.
65306533
///
65316534
/// After initial signatures have been exchanged, [`Event::FundingTransactionReadyForSigning`]
65326535
/// will be generated and [`ChannelManager::funding_transaction_signed`] should be called.

0 commit comments

Comments
 (0)