@@ -927,9 +927,9 @@ impl <SP: Deref> PeerState<SP> where SP::Target: SignerProvider {
927927 match phase {
928928 ChannelPhase::Funded(_) | ChannelPhase::UnfundedOutboundV1(_) => true,
929929 ChannelPhase::UnfundedInboundV1(_) => false,
930- #[cfg(dual_funding)]
930+ #[cfg(any( dual_funding, splicing) )]
931931 ChannelPhase::UnfundedOutboundV2(_) => true,
932- #[cfg(dual_funding)]
932+ #[cfg(any( dual_funding, splicing) )]
933933 ChannelPhase::UnfundedInboundV2(_) => false,
934934 }
935935 )
@@ -2791,11 +2791,11 @@ macro_rules! convert_chan_phase_err {
27912791 ChannelPhase::UnfundedInboundV1(channel) => {
27922792 convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
27932793 },
2794- #[cfg(dual_funding)]
2794+ #[cfg(any( dual_funding, splicing) )]
27952795 ChannelPhase::UnfundedOutboundV2(channel) => {
27962796 convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
27972797 },
2798- #[cfg(dual_funding)]
2798+ #[cfg(any( dual_funding, splicing) )]
27992799 ChannelPhase::UnfundedInboundV2(channel) => {
28002800 convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
28012801 },
@@ -3670,8 +3670,8 @@ where
36703670 // Unfunded channel has no update
36713671 (None, chan_phase.context().get_counterparty_node_id())
36723672 },
3673- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
3674- #[cfg(dual_funding)]
3673+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
3674+ #[cfg(any( dual_funding, splicing) )]
36753675 ChannelPhase::UnfundedOutboundV2(_) | ChannelPhase::UnfundedInboundV2(_) => {
36763676 self.finish_close_channel(chan_phase.context_mut().force_shutdown(false, closure_reason));
36773677 // Unfunded channel has no update
@@ -5902,12 +5902,12 @@ where
59025902 process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
59035903 pending_msg_events, counterparty_node_id)
59045904 },
5905- #[cfg(dual_funding)]
5905+ #[cfg(any( dual_funding, splicing) )]
59065906 ChannelPhase::UnfundedInboundV2(chan) => {
59075907 process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
59085908 pending_msg_events, counterparty_node_id)
59095909 },
5910- #[cfg(dual_funding)]
5910+ #[cfg(any( dual_funding, splicing) )]
59115911 ChannelPhase::UnfundedOutboundV2(chan) => {
59125912 process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
59135913 pending_msg_events, counterparty_node_id)
@@ -7079,8 +7079,8 @@ where
70797079 num_unfunded_channels += 1;
70807080 }
70817081 },
7082- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
7083- #[cfg(dual_funding)]
7082+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
7083+ #[cfg(any( dual_funding, splicing) )]
70847084 ChannelPhase::UnfundedInboundV2(chan) => {
70857085 // Only inbound V2 channels that are not 0conf and that we do not contribute to will be
70867086 // included in the unfunded count.
@@ -7093,8 +7093,8 @@ where
70937093 // Outbound channels don't contribute to the unfunded count in the DoS context.
70947094 continue;
70957095 },
7096- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
7097- #[cfg(dual_funding)]
7096+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
7097+ #[cfg(any( dual_funding, splicing) )]
70987098 ChannelPhase::UnfundedOutboundV2(_) => {
70997099 // Outbound channels don't contribute to the unfunded count in the DoS context.
71007100 continue;
@@ -7521,7 +7521,7 @@ where
75217521 finish_shutdown = Some(chan.context_mut().force_shutdown(false, ClosureReason::CounterpartyCoopClosedUnfundedChannel));
75227522 },
75237523 // TODO(dual_funding): Combine this match arm with above.
7524- #[cfg(dual_funding)]
7524+ #[cfg(any( dual_funding, splicing) )]
75257525 ChannelPhase::UnfundedInboundV2(_) | ChannelPhase::UnfundedOutboundV2(_) => {
75267526 let context = phase.context_mut();
75277527 log_error!(self.logger, "Immediately closing unfunded channel {} as peer asked to cooperatively shut it down (which is unnecessary)", &msg.channel_id);
@@ -9474,7 +9474,7 @@ where
94749474 // Retain unfunded channels.
94759475 ChannelPhase::UnfundedOutboundV1(_) | ChannelPhase::UnfundedInboundV1(_) => true,
94769476 // TODO(dual_funding): Combine this match arm with above.
9477- #[cfg(dual_funding)]
9477+ #[cfg(any( dual_funding, splicing) )]
94789478 ChannelPhase::UnfundedOutboundV2(_) | ChannelPhase::UnfundedInboundV2(_) => true,
94799479 ChannelPhase::Funded(channel) => {
94809480 let res = f(channel);
@@ -9780,21 +9780,21 @@ where
97809780 msg.channel_id.clone())), *counterparty_node_id);
97819781 }
97829782
9783- #[cfg(dual_funding )]
9783+ #[cfg(splicing )]
97849784 fn handle_splice(&self, counterparty_node_id: &PublicKey, msg: &msgs::Splice) {
97859785 let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
97869786 "Splicing not supported".to_owned(),
97879787 msg.channel_id.clone())), *counterparty_node_id);
97889788 }
97899789
9790- #[cfg(dual_funding )]
9790+ #[cfg(splicing )]
97919791 fn handle_splice_ack(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceAck) {
97929792 let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
97939793 "Splicing not supported (splice_ack)".to_owned(),
97949794 msg.channel_id.clone())), *counterparty_node_id);
97959795 }
97969796
9797- #[cfg(dual_funding )]
9797+ #[cfg(splicing )]
97989798 fn handle_splice_locked(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceLocked) {
97999799 let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
98009800 "Splicing not supported (splice_locked)".to_owned(),
@@ -9952,11 +9952,11 @@ where
99529952 ChannelPhase::UnfundedInboundV1(chan) => {
99539953 &mut chan.context
99549954 },
9955- #[cfg(dual_funding)]
9955+ #[cfg(any( dual_funding, splicing) )]
99569956 ChannelPhase::UnfundedOutboundV2(chan) => {
99579957 &mut chan.context
99589958 },
9959- #[cfg(dual_funding)]
9959+ #[cfg(any( dual_funding, splicing) )]
99609960 ChannelPhase::UnfundedInboundV2(chan) => {
99619961 &mut chan.context
99629962 },
@@ -10117,8 +10117,8 @@ where
1011710117 });
1011810118 }
1011910119
10120- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
10121- #[cfg(dual_funding)]
10120+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
10121+ #[cfg(any( dual_funding, splicing) )]
1012210122 ChannelPhase::UnfundedOutboundV2(chan) => {
1012310123 pending_msg_events.push(events::MessageSendEvent::SendOpenChannelV2 {
1012410124 node_id: chan.context.get_counterparty_node_id(),
@@ -10133,8 +10133,8 @@ where
1013310133 debug_assert!(false);
1013410134 }
1013510135
10136- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
10137- #[cfg(dual_funding)]
10136+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
10137+ #[cfg(any( dual_funding, splicing) )]
1013810138 ChannelPhase::UnfundedInboundV2(channel) => {
1013910139 // Since unfunded inbound channel maps are cleared upon disconnecting a peer,
1014010140 // they are not persisted and won't be recovered after a crash.
@@ -10237,7 +10237,7 @@ where
1023710237 return;
1023810238 }
1023910239 },
10240- #[cfg(dual_funding)]
10240+ #[cfg(any( dual_funding, splicing) )]
1024110241 Some(ChannelPhase::UnfundedOutboundV2(ref mut chan)) => {
1024210242 if let Ok(msg) = chan.maybe_handle_error_without_close(self.chain_hash, &self.fee_estimator) {
1024310243 peer_state.pending_msg_events.push(events::MessageSendEvent::SendOpenChannelV2 {
@@ -10248,7 +10248,7 @@ where
1024810248 }
1024910249 },
1025010250 None | Some(ChannelPhase::UnfundedInboundV1(_) | ChannelPhase::Funded(_)) => (),
10251- #[cfg(dual_funding)]
10251+ #[cfg(any( dual_funding, splicing) )]
1025210252 Some(ChannelPhase::UnfundedInboundV2(_)) => (),
1025310253 }
1025410254 }
0 commit comments