@@ -1665,12 +1665,12 @@ where
1665
1665
/// send our peer to begin the channel reconnection process.
1666
1666
#[rustfmt::skip]
1667
1667
pub fn peer_connected_get_handshake<L: Deref>(
1668
- &mut self, chain_hash: ChainHash, their_features: &InitFeatures, logger: &L,
1668
+ &mut self, chain_hash: ChainHash, logger: &L,
1669
1669
) -> ReconnectionMsg where L::Target: Logger {
1670
1670
match &mut self.phase {
1671
1671
ChannelPhase::Undefined => unreachable!(),
1672
1672
ChannelPhase::Funded(chan) =>
1673
- ReconnectionMsg::Reestablish(chan.get_channel_reestablish(their_features, logger)),
1673
+ ReconnectionMsg::Reestablish(chan.get_channel_reestablish(logger)),
1674
1674
ChannelPhase::UnfundedOutboundV1(chan) => {
1675
1675
chan.get_open_channel(chain_hash, logger)
1676
1676
.map(|msg| ReconnectionMsg::Open(OpenChannelMessage::V1(msg)))
@@ -10136,11 +10136,7 @@ where
10136
10136
}
10137
10137
10138
10138
#[cfg(splicing)]
10139
- fn maybe_get_your_last_funding_locked_txid(&self, features: &InitFeatures) -> Option<Txid> {
10140
- if !features.supports_splicing() {
10141
- return None;
10142
- }
10143
-
10139
+ fn maybe_get_your_last_funding_locked_txid(&self) -> Option<Txid> {
10144
10140
self.pending_splice
10145
10141
.as_ref()
10146
10142
.and_then(|pending_splice| pending_splice.received_funding_txid)
@@ -10149,16 +10145,12 @@ where
10149
10145
})
10150
10146
}
10151
10147
#[cfg(not(splicing))]
10152
- fn maybe_get_your_last_funding_locked_txid(&self, _features: &InitFeatures ) -> Option<Txid> {
10148
+ fn maybe_get_your_last_funding_locked_txid(&self) -> Option<Txid> {
10153
10149
None
10154
10150
}
10155
10151
10156
10152
#[cfg(splicing)]
10157
- fn maybe_get_my_current_funding_locked_txid(&self, features: &InitFeatures) -> Option<Txid> {
10158
- if !features.supports_splicing() {
10159
- return None;
10160
- }
10161
-
10153
+ fn maybe_get_my_current_funding_locked_txid(&self) -> Option<Txid> {
10162
10154
self.pending_splice
10163
10155
.as_ref()
10164
10156
.and_then(|pending_splice| pending_splice.sent_funding_txid)
@@ -10168,19 +10160,14 @@ where
10168
10160
}
10169
10161
10170
10162
#[cfg(not(splicing))]
10171
- fn maybe_get_my_current_funding_locked_txid(&self, _features: &InitFeatures ) -> Option<Txid> {
10163
+ fn maybe_get_my_current_funding_locked_txid(&self) -> Option<Txid> {
10172
10164
None
10173
10165
}
10174
10166
10175
10167
/// May panic if called on a channel that wasn't immediately-previously
10176
10168
/// self.remove_uncommitted_htlcs_and_mark_paused()'d
10177
10169
#[rustfmt::skip]
10178
- fn get_channel_reestablish<L: Deref>(
10179
- &mut self, their_features: &InitFeatures, logger: &L,
10180
- ) -> msgs::ChannelReestablish
10181
- where
10182
- L::Target: Logger,
10183
- {
10170
+ fn get_channel_reestablish<L: Deref>(&mut self, logger: &L) -> msgs::ChannelReestablish where L::Target: Logger {
10184
10171
assert!(self.context.channel_state.is_peer_disconnected());
10185
10172
assert_ne!(self.context.cur_counterparty_commitment_transaction_number, INITIAL_COMMITMENT_NUMBER);
10186
10173
// This is generally the first function which gets called on any given channel once we're
@@ -10228,8 +10215,8 @@ where
10228
10215
your_last_per_commitment_secret: remote_last_secret,
10229
10216
my_current_per_commitment_point: dummy_pubkey,
10230
10217
next_funding_txid: self.maybe_get_next_funding_txid(),
10231
- your_last_funding_locked_txid: self.maybe_get_your_last_funding_locked_txid(their_features ),
10232
- my_current_funding_locked_txid: self.maybe_get_my_current_funding_locked_txid(their_features ),
10218
+ your_last_funding_locked_txid: self.maybe_get_your_last_funding_locked_txid(),
10219
+ my_current_funding_locked_txid: self.maybe_get_my_current_funding_locked_txid(),
10233
10220
}
10234
10221
}
10235
10222
@@ -13740,15 +13727,15 @@ mod tests {
13740
13727
// Now disconnect the two nodes and check that the commitment point in
13741
13728
// Node B's channel_reestablish message is sane.
13742
13729
assert!(node_b_chan.remove_uncommitted_htlcs_and_mark_paused(&&logger).is_ok());
13743
- let msg = node_b_chan.get_channel_reestablish(&channelmanager::provided_init_features(&config), & &logger);
13730
+ let msg = node_b_chan.get_channel_reestablish(&&logger);
13744
13731
assert_eq!(msg.next_local_commitment_number, 1); // now called next_commitment_number
13745
13732
assert_eq!(msg.next_remote_commitment_number, 0); // now called next_revocation_number
13746
13733
assert_eq!(msg.your_last_per_commitment_secret, [0; 32]);
13747
13734
13748
13735
// Check that the commitment point in Node A's channel_reestablish message
13749
13736
// is sane.
13750
13737
assert!(node_a_chan.remove_uncommitted_htlcs_and_mark_paused(&&logger).is_ok());
13751
- let msg = node_a_chan.get_channel_reestablish(&channelmanager::provided_init_features(&config), & &logger);
13738
+ let msg = node_a_chan.get_channel_reestablish(&&logger);
13752
13739
assert_eq!(msg.next_local_commitment_number, 1); // now called next_commitment_number
13753
13740
assert_eq!(msg.next_remote_commitment_number, 0); // now called next_revocation_number
13754
13741
assert_eq!(msg.your_last_per_commitment_secret, [0; 32]);
0 commit comments