@@ -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)))
@@ -10561,11 +10561,7 @@ where
10561
10561
}
10562
10562
10563
10563
#[cfg(splicing)]
10564
- fn maybe_get_your_last_funding_locked_txid(&self, features: &InitFeatures) -> Option<Txid> {
10565
- if !features.supports_splicing() {
10566
- return None;
10567
- }
10568
-
10564
+ fn maybe_get_your_last_funding_locked_txid(&self) -> Option<Txid> {
10569
10565
self.pending_splice
10570
10566
.as_ref()
10571
10567
.and_then(|pending_splice| pending_splice.received_funding_txid)
@@ -10574,16 +10570,12 @@ where
10574
10570
})
10575
10571
}
10576
10572
#[cfg(not(splicing))]
10577
- fn maybe_get_your_last_funding_locked_txid(&self, _features: &InitFeatures ) -> Option<Txid> {
10573
+ fn maybe_get_your_last_funding_locked_txid(&self) -> Option<Txid> {
10578
10574
None
10579
10575
}
10580
10576
10581
10577
#[cfg(splicing)]
10582
- fn maybe_get_my_current_funding_locked_txid(&self, features: &InitFeatures) -> Option<Txid> {
10583
- if !features.supports_splicing() {
10584
- return None;
10585
- }
10586
-
10578
+ fn maybe_get_my_current_funding_locked_txid(&self) -> Option<Txid> {
10587
10579
self.pending_splice
10588
10580
.as_ref()
10589
10581
.and_then(|pending_splice| pending_splice.sent_funding_txid)
@@ -10593,19 +10585,14 @@ where
10593
10585
}
10594
10586
10595
10587
#[cfg(not(splicing))]
10596
- fn maybe_get_my_current_funding_locked_txid(&self, _features: &InitFeatures ) -> Option<Txid> {
10588
+ fn maybe_get_my_current_funding_locked_txid(&self) -> Option<Txid> {
10597
10589
None
10598
10590
}
10599
10591
10600
10592
/// May panic if called on a channel that wasn't immediately-previously
10601
10593
/// self.remove_uncommitted_htlcs_and_mark_paused()'d
10602
10594
#[rustfmt::skip]
10603
- fn get_channel_reestablish<L: Deref>(
10604
- &mut self, their_features: &InitFeatures, logger: &L,
10605
- ) -> msgs::ChannelReestablish
10606
- where
10607
- L::Target: Logger,
10608
- {
10595
+ fn get_channel_reestablish<L: Deref>(&mut self, logger: &L) -> msgs::ChannelReestablish where L::Target: Logger {
10609
10596
assert!(self.context.channel_state.is_peer_disconnected());
10610
10597
assert_ne!(self.context.cur_counterparty_commitment_transaction_number, INITIAL_COMMITMENT_NUMBER);
10611
10598
// This is generally the first function which gets called on any given channel once we're
@@ -10653,8 +10640,8 @@ where
10653
10640
your_last_per_commitment_secret: remote_last_secret,
10654
10641
my_current_per_commitment_point: dummy_pubkey,
10655
10642
next_funding_txid: self.maybe_get_next_funding_txid(),
10656
- your_last_funding_locked_txid: self.maybe_get_your_last_funding_locked_txid(their_features ),
10657
- my_current_funding_locked_txid: self.maybe_get_my_current_funding_locked_txid(their_features ),
10643
+ your_last_funding_locked_txid: self.maybe_get_your_last_funding_locked_txid(),
10644
+ my_current_funding_locked_txid: self.maybe_get_my_current_funding_locked_txid(),
10658
10645
}
10659
10646
}
10660
10647
@@ -14517,15 +14504,15 @@ mod tests {
14517
14504
// Now disconnect the two nodes and check that the commitment point in
14518
14505
// Node B's channel_reestablish message is sane.
14519
14506
assert!(node_b_chan.remove_uncommitted_htlcs_and_mark_paused(&&logger).is_ok());
14520
- let msg = node_b_chan.get_channel_reestablish(&channelmanager::provided_init_features(&config), & &logger);
14507
+ let msg = node_b_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]);
14524
14511
14525
14512
// Check that the commitment point in Node A's channel_reestablish message
14526
14513
// is sane.
14527
14514
assert!(node_a_chan.remove_uncommitted_htlcs_and_mark_paused(&&logger).is_ok());
14528
- let msg = node_a_chan.get_channel_reestablish(&channelmanager::provided_init_features(&config), & &logger);
14515
+ let msg = node_a_chan.get_channel_reestablish(&&logger);
14529
14516
assert_eq!(msg.next_local_commitment_number, 1); // now called next_commitment_number
14530
14517
assert_eq!(msg.next_remote_commitment_number, 0); // now called next_revocation_number
14531
14518
assert_eq!(msg.your_last_per_commitment_secret, [0; 32]);
0 commit comments