Skip to content

Commit a7b4519

Browse files
authored
Merge pull request #4427 from jkczyz/2026-02-splicing-rbf
RBF splice funding transactions
2 parents 123c757 + 5e521ac commit a7b4519

8 files changed

Lines changed: 2673 additions & 210 deletions

File tree

lightning-tests/src/upgrade_downgrade_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ fn do_test_0_1_htlc_forward_after_splice(fail_htlc: bool) {
466466
}
467467

468468
let splice_locked = get_event_msg!(nodes[0], MessageSendEvent::SendSpliceLocked, node_b_id);
469-
lock_splice(&nodes[0], &nodes[1], &splice_locked, false);
469+
lock_splice(&nodes[0], &nodes[1], &splice_locked, false, &[]);
470470

471471
for node in nodes.iter() {
472472
connect_blocks(node, EXTRA_BLOCKS_BEFORE_FAIL - ANTI_REORG_DELAY);

lightning/src/chain/channelmonitor.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4041,9 +4041,16 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
40414041
}
40424042

40434043
if let Some(parent_funding_txid) = channel_parameters.splice_parent_funding_txid.as_ref() {
4044-
// Only one splice can be negotiated at a time after we've exchanged `channel_ready`
4045-
// (implying our funding is confirmed) that spends our currently locked funding.
4046-
if !self.pending_funding.is_empty() {
4044+
// Multiple RBF candidates for the same splice are allowed (they share the same
4045+
// parent funding txid). A new splice with a different parent while one is pending
4046+
// is not allowed. This also ensures a dual-funded channel has exchanged
4047+
// `channel_ready` (implying funding is confirmed) before allowing a splice,
4048+
// since unconfirmed initial funding has no splice parent.
4049+
let has_different_parent = self.pending_funding.iter().any(|funding| {
4050+
funding.channel_parameters.splice_parent_funding_txid.as_ref()
4051+
!= Some(parent_funding_txid)
4052+
});
4053+
if has_different_parent {
40474054
log_error!(
40484055
logger,
40494056
"Negotiated splice while channel is pending channel_ready/splice_locked"

0 commit comments

Comments
 (0)