Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightning-tests/src/upgrade_downgrade_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ fn do_test_0_1_htlc_forward_after_splice(fail_htlc: bool) {
}

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

for node in nodes.iter() {
connect_blocks(node, EXTRA_BLOCKS_BEFORE_FAIL - ANTI_REORG_DELAY);
Expand Down
13 changes: 10 additions & 3 deletions lightning/src/chain/channelmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4039,9 +4039,16 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
}

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