Skip to content

Commit 3189e0a

Browse files
committed
Revert "Update channel_reestablish logic for channel_ready"
This reverts commit 1426949.
1 parent 1426949 commit 3189e0a

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8667,8 +8667,7 @@ where
86678667
#[rustfmt::skip]
86688668
pub fn channel_reestablish<L: Deref, NS: Deref>(
86698669
&mut self, msg: &msgs::ChannelReestablish, logger: &L, node_signer: &NS,
8670-
chain_hash: ChainHash, their_features: &InitFeatures, user_config: &UserConfig,
8671-
best_block: &BestBlock,
8670+
chain_hash: ChainHash, user_config: &UserConfig, best_block: &BestBlock
86728671
) -> Result<ReestablishResponses, ChannelError>
86738672
where
86748673
L::Target: Logger,
@@ -8791,21 +8790,9 @@ where
87918790
let is_awaiting_remote_revoke = self.context.channel_state.is_awaiting_remote_revoke();
87928791
let next_counterparty_commitment_number = INITIAL_COMMITMENT_NUMBER - self.context.cur_counterparty_commitment_transaction_number + if is_awaiting_remote_revoke { 1 } else { 0 };
87938792

8794-
let our_features = channelmanager::provided_init_features(user_config);
8795-
let splicing_negotiated =
8796-
our_features.supports_splicing() && their_features.supports_splicing();
8797-
let channel_ready = if msg.next_local_commitment_number == 1 && INITIAL_COMMITMENT_NUMBER - self.holder_commitment_point.transaction_number() == 1 && !splicing_negotiated {
8793+
let channel_ready = if msg.next_local_commitment_number == 1 && INITIAL_COMMITMENT_NUMBER - self.holder_commitment_point.transaction_number() == 1 {
87988794
// We should never have to worry about MonitorUpdateInProgress resending ChannelReady
87998795
self.get_channel_ready(logger)
8800-
} else if splicing_negotiated {
8801-
// A node:
8802-
// - if `option_splice` was negotiated and `your_last_funding_locked` is not
8803-
// set in the `channel_reestablish` it received:
8804-
// - MUST retransmit `channel_ready`.
8805-
msg.your_last_funding_locked_txid
8806-
.is_none()
8807-
.then(|| ())
8808-
.and_then(|_| self.get_channel_ready(logger))
88098796
} else { None };
88108797

88118798
if msg.next_local_commitment_number == next_counterparty_commitment_number {

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10983,13 +10983,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1098310983
match peer_state.channel_by_id.entry(msg.channel_id) {
1098410984
hash_map::Entry::Occupied(mut chan_entry) => {
1098510985
if let Some(chan) = chan_entry.get_mut().as_funded_mut() {
10986-
let features = &peer_state.latest_features;
1098710986
// Currently, we expect all holding cell update_adds to be dropped on peer
1098810987
// disconnect, so Channel's reestablish will never hand us any holding cell
1098910988
// freed HTLCs to fail backwards. If in the future we no longer drop pending
1099010989
// add-HTLCs on disconnect, we may be handed HTLCs to fail backwards here.
1099110990
let responses = try_channel_entry!(self, peer_state, chan.channel_reestablish(
10992-
msg, &&logger, &self.node_signer, self.chain_hash, features,
10991+
msg, &&logger, &self.node_signer, self.chain_hash,
1099310992
&self.default_configuration, &*self.best_block.read().unwrap()), chan_entry);
1099410993
let mut channel_update = None;
1099510994
if let Some(msg) = responses.shutdown_msg {

0 commit comments

Comments
 (0)