@@ -1664,12 +1664,12 @@ where
1664
1664
/// send our peer to begin the channel reconnection process.
1665
1665
#[rustfmt::skip]
1666
1666
pub fn peer_connected_get_handshake<L: Deref>(
1667
- &mut self, chain_hash: ChainHash, their_features: &InitFeatures, logger: &L,
1667
+ &mut self, chain_hash: ChainHash, logger: &L,
1668
1668
) -> ReconnectionMsg where L::Target: Logger {
1669
1669
match &mut self.phase {
1670
1670
ChannelPhase::Undefined => unreachable!(),
1671
1671
ChannelPhase::Funded(chan) =>
1672
- ReconnectionMsg::Reestablish(chan.get_channel_reestablish(their_features, logger)),
1672
+ ReconnectionMsg::Reestablish(chan.get_channel_reestablish(logger)),
1673
1673
ChannelPhase::UnfundedOutboundV1(chan) => {
1674
1674
chan.get_open_channel(chain_hash, logger)
1675
1675
.map(|msg| ReconnectionMsg::Open(OpenChannelMessage::V1(msg)))
@@ -10549,11 +10549,7 @@ where
10549
10549
}
10550
10550
10551
10551
#[cfg(splicing)]
10552
- fn maybe_get_your_last_funding_locked_txid(&self, features: &InitFeatures) -> Option<Txid> {
10553
- if !features.supports_splicing() {
10554
- return None;
10555
- }
10556
-
10552
+ fn maybe_get_your_last_funding_locked_txid(&self) -> Option<Txid> {
10557
10553
self.pending_splice
10558
10554
.as_ref()
10559
10555
.and_then(|pending_splice| pending_splice.received_funding_txid)
@@ -10562,16 +10558,12 @@ where
10562
10558
})
10563
10559
}
10564
10560
#[cfg(not(splicing))]
10565
- fn maybe_get_your_last_funding_locked_txid(&self, _features: &InitFeatures ) -> Option<Txid> {
10561
+ fn maybe_get_your_last_funding_locked_txid(&self) -> Option<Txid> {
10566
10562
None
10567
10563
}
10568
10564
10569
10565
#[cfg(splicing)]
10570
- fn maybe_get_my_current_funding_locked_txid(&self, features: &InitFeatures) -> Option<Txid> {
10571
- if !features.supports_splicing() {
10572
- return None;
10573
- }
10574
-
10566
+ fn maybe_get_my_current_funding_locked_txid(&self) -> Option<Txid> {
10575
10567
self.pending_splice
10576
10568
.as_ref()
10577
10569
.and_then(|pending_splice| pending_splice.sent_funding_txid)
@@ -10581,19 +10573,14 @@ where
10581
10573
}
10582
10574
10583
10575
#[cfg(not(splicing))]
10584
- fn maybe_get_my_current_funding_locked_txid(&self, _features: &InitFeatures ) -> Option<Txid> {
10576
+ fn maybe_get_my_current_funding_locked_txid(&self) -> Option<Txid> {
10585
10577
None
10586
10578
}
10587
10579
10588
10580
/// May panic if called on a channel that wasn't immediately-previously
10589
10581
/// self.remove_uncommitted_htlcs_and_mark_paused()'d
10590
10582
#[rustfmt::skip]
10591
- fn get_channel_reestablish<L: Deref>(
10592
- &mut self, their_features: &InitFeatures, logger: &L,
10593
- ) -> msgs::ChannelReestablish
10594
- where
10595
- L::Target: Logger,
10596
- {
10583
+ fn get_channel_reestablish<L: Deref>(&mut self, logger: &L) -> msgs::ChannelReestablish where L::Target: Logger {
10597
10584
assert!(self.context.channel_state.is_peer_disconnected());
10598
10585
assert_ne!(self.context.cur_counterparty_commitment_transaction_number, INITIAL_COMMITMENT_NUMBER);
10599
10586
// This is generally the first function which gets called on any given channel once we're
@@ -10641,8 +10628,8 @@ where
10641
10628
your_last_per_commitment_secret: remote_last_secret,
10642
10629
my_current_per_commitment_point: dummy_pubkey,
10643
10630
next_funding_txid: self.maybe_get_next_funding_txid(),
10644
- your_last_funding_locked_txid: self.maybe_get_your_last_funding_locked_txid(their_features ),
10645
- my_current_funding_locked_txid: self.maybe_get_my_current_funding_locked_txid(their_features ),
10631
+ your_last_funding_locked_txid: self.maybe_get_your_last_funding_locked_txid(),
10632
+ my_current_funding_locked_txid: self.maybe_get_my_current_funding_locked_txid(),
10646
10633
}
10647
10634
}
10648
10635
@@ -14509,15 +14496,15 @@ mod tests {
14509
14496
// Now disconnect the two nodes and check that the commitment point in
14510
14497
// Node B's channel_reestablish message is sane.
14511
14498
assert!(node_b_chan.remove_uncommitted_htlcs_and_mark_paused(&&logger).is_ok());
14512
- let msg = node_b_chan.get_channel_reestablish(&channelmanager::provided_init_features(&config), & &logger);
14499
+ let msg = node_b_chan.get_channel_reestablish(&&logger);
14513
14500
assert_eq!(msg.next_local_commitment_number, 1); // now called next_commitment_number
14514
14501
assert_eq!(msg.next_remote_commitment_number, 0); // now called next_revocation_number
14515
14502
assert_eq!(msg.your_last_per_commitment_secret, [0; 32]);
14516
14503
14517
14504
// Check that the commitment point in Node A's channel_reestablish message
14518
14505
// is sane.
14519
14506
assert!(node_a_chan.remove_uncommitted_htlcs_and_mark_paused(&&logger).is_ok());
14520
- let msg = node_a_chan.get_channel_reestablish(&channelmanager::provided_init_features(&config), & &logger);
14507
+ let msg = node_a_chan.get_channel_reestablish(&&logger);
14521
14508
assert_eq!(msg.next_local_commitment_number, 1); // now called next_commitment_number
14522
14509
assert_eq!(msg.next_remote_commitment_number, 0); // now called next_revocation_number
14523
14510
assert_eq!(msg.your_last_per_commitment_secret, [0; 32]);
0 commit comments