Skip to content

Commit ad614a8

Browse files
committed
Revert "Send splice_locked on channel_reestablish"
This reverts commit c60fc4bb477bcd3532473047805ddd91733f469a.
1 parent 41647ee commit ad614a8

File tree

2 files changed

+3
-61
lines changed

2 files changed

+3
-61
lines changed

lightning/src/ln/channel.rs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,6 @@ pub(super) struct ReestablishResponses {
12151215
pub shutdown_msg: Option<msgs::Shutdown>,
12161216
pub tx_signatures: Option<msgs::TxSignatures>,
12171217
pub tx_abort: Option<msgs::TxAbort>,
1218-
pub splice_locked: Option<msgs::SpliceLocked>,
12191218
}
12201219

12211220
/// The first message we send to our peer after connection
@@ -2242,11 +2241,6 @@ impl FundingScope {
22422241
self.short_channel_id
22432242
}
22442243

2245-
/// Returns whether the `FundingScope` is for splicing a channel.
2246-
fn is_splice(&self) -> bool {
2247-
self.channel_transaction_parameters.splice_parent_funding_txid.is_some()
2248-
}
2249-
22502244
/// Constructs a `FundingScope` for splicing a channel.
22512245
#[cfg(splicing)]
22522246
fn for_splice<SP: Deref>(
@@ -8755,7 +8749,6 @@ where
87558749
shutdown_msg, announcement_sigs,
87568750
tx_signatures: None,
87578751
tx_abort: None,
8758-
splice_locked: None,
87598752
});
87608753
}
87618754

@@ -8767,7 +8760,6 @@ where
87678760
shutdown_msg, announcement_sigs,
87688761
tx_signatures: None,
87698762
tx_abort: None,
8770-
splice_locked: None,
87718763
});
87728764
}
87738765

@@ -8803,25 +8795,6 @@ where
88038795
self.get_channel_ready(logger)
88048796
} else { None };
88058797

8806-
// A receiving node:
8807-
// - if `your_last_funding_locked` is set and it does not match the most recent
8808-
// `splice_locked` it has sent:
8809-
// - MUST retransmit `splice_locked`.
8810-
let sent_splice_txid = self
8811-
.maybe_get_my_current_funding_locked()
8812-
.filter(|funding| funding.is_splice())
8813-
.map(|funding| {
8814-
funding.get_funding_txid().expect("Splice funding_txid should always be set")
8815-
});
8816-
let splice_locked = msg.your_last_funding_locked_txid.and_then(|last_funding_txid| {
8817-
sent_splice_txid
8818-
.filter(|sent_splice_txid| last_funding_txid != *sent_splice_txid)
8819-
.map(|splice_txid| msgs::SpliceLocked {
8820-
channel_id: self.context.channel_id,
8821-
splice_txid,
8822-
})
8823-
});
8824-
88258798
let mut commitment_update = None;
88268799
let mut tx_signatures = None;
88278800
let mut tx_abort = None;
@@ -8930,7 +8903,6 @@ where
89308903
order: self.context.resend_order.clone(),
89318904
tx_signatures,
89328905
tx_abort,
8933-
splice_locked,
89348906
})
89358907
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
89368908
// We've made an update so we must have exchanged `tx_signatures`, implying that
@@ -8952,7 +8924,6 @@ where
89528924
order: self.context.resend_order.clone(),
89538925
tx_signatures,
89548926
tx_abort,
8955-
splice_locked,
89568927
})
89578928
} else {
89588929
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -8977,7 +8948,6 @@ where
89778948
order: self.context.resend_order.clone(),
89788949
tx_signatures,
89798950
tx_abort,
8980-
splice_locked,
89818951
})
89828952
}
89838953
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
@@ -10628,24 +10598,6 @@ where
1062810598
None
1062910599
}
1063010600

10631-
#[cfg(splicing)]
10632-
fn maybe_get_my_current_funding_locked(&self) -> Option<&FundingScope> {
10633-
self.pending_splice
10634-
.as_ref()
10635-
.and_then(|pending_splice| pending_splice.sent_funding_txid)
10636-
.and_then(|funding_txid| {
10637-
self.pending_funding
10638-
.iter()
10639-
.find(|funding| funding.get_funding_txid() == Some(funding_txid))
10640-
})
10641-
.or_else(|| self.is_our_channel_ready().then(|| &self.funding))
10642-
}
10643-
10644-
#[cfg(not(splicing))]
10645-
fn maybe_get_my_current_funding_locked(&self) -> Option<&FundingScope> {
10646-
None
10647-
}
10648-
1064910601
/// May panic if called on a channel that wasn't immediately-previously
1065010602
/// self.remove_uncommitted_htlcs_and_mark_paused()'d
1065110603
#[rustfmt::skip]

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3402,8 +3402,7 @@ macro_rules! handle_monitor_update_completion {
34023402
&mut $peer_state.pending_msg_events, $chan, updates.raa,
34033403
updates.commitment_update, updates.order, updates.accepted_htlcs, updates.pending_update_adds,
34043404
updates.funding_broadcastable, updates.channel_ready,
3405-
updates.announcement_sigs, updates.tx_signatures, None, None,
3406-
);
3405+
updates.announcement_sigs, updates.tx_signatures, None);
34073406
if let Some(upd) = channel_update {
34083407
$peer_state.pending_msg_events.push(upd);
34093408
}
@@ -8919,10 +8918,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
89198918
funding_broadcastable: Option<Transaction>,
89208919
channel_ready: Option<msgs::ChannelReady>, announcement_sigs: Option<msgs::AnnouncementSignatures>,
89218920
tx_signatures: Option<msgs::TxSignatures>, tx_abort: Option<msgs::TxAbort>,
8922-
splice_locked: Option<msgs::SpliceLocked>,
89238921
) -> (Option<(u64, PublicKey, OutPoint, ChannelId, u128, Vec<(PendingHTLCInfo, u64)>)>, Option<(u64, Vec<msgs::UpdateAddHTLC>)>) {
89248922
let logger = WithChannelContext::from(&self.logger, &channel.context, None);
8925-
log_trace!(logger, "Handling channel resumption for channel {} with {} RAA, {} commitment update, {} pending forwards, {} pending update_add_htlcs, {}broadcasting funding, {} channel ready, {} announcement, {} tx_signatures, {} tx_abort, {} splice_locked",
8923+
log_trace!(logger, "Handling channel resumption for channel {} with {} RAA, {} commitment update, {} pending forwards, {} pending update_add_htlcs, {}broadcasting funding, {} channel ready, {} announcement, {} tx_signatures, {} tx_abort",
89268924
&channel.context.channel_id(),
89278925
if raa.is_some() { "an" } else { "no" },
89288926
if commitment_update.is_some() { "a" } else { "no" },
@@ -8932,7 +8930,6 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
89328930
if announcement_sigs.is_some() { "sending" } else { "without" },
89338931
if tx_signatures.is_some() { "sending" } else { "without" },
89348932
if tx_abort.is_some() { "sending" } else { "without" },
8935-
if splice_locked.is_some() { "sending" } else { "without" },
89368933
);
89378934

89388935
let counterparty_node_id = channel.context.get_counterparty_node_id();
@@ -8973,12 +8970,6 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
89738970
msg,
89748971
});
89758972
}
8976-
if let Some(msg) = splice_locked {
8977-
pending_msg_events.push(MessageSendEvent::SendSpliceLocked {
8978-
node_id: counterparty_node_id,
8979-
msg,
8980-
});
8981-
}
89828973

89838974
macro_rules! handle_cs { () => {
89848975
if let Some(update) = commitment_update {
@@ -11020,8 +11011,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1102011011
let (htlc_forwards, decode_update_add_htlcs) = self.handle_channel_resumption(
1102111012
&mut peer_state.pending_msg_events, chan, responses.raa, responses.commitment_update, responses.order,
1102211013
Vec::new(), Vec::new(), None, responses.channel_ready, responses.announcement_sigs,
11023-
responses.tx_signatures, responses.tx_abort, responses.splice_locked,
11024-
);
11014+
responses.tx_signatures, responses.tx_abort);
1102511015
debug_assert!(htlc_forwards.is_none());
1102611016
debug_assert!(decode_update_add_htlcs.is_none());
1102711017
if let Some(upd) = channel_update {

0 commit comments

Comments
 (0)