@@ -918,9 +918,9 @@ impl <SP: Deref> PeerState<SP> where SP::Target: SignerProvider {
918918 match phase {
919919 ChannelPhase::Funded(_) | ChannelPhase::UnfundedOutboundV1(_) => true,
920920 ChannelPhase::UnfundedInboundV1(_) => false,
921- #[cfg(dual_funding)]
921+ #[cfg(any( dual_funding, splicing) )]
922922 ChannelPhase::UnfundedOutboundV2(_) => true,
923- #[cfg(dual_funding)]
923+ #[cfg(any( dual_funding, splicing) )]
924924 ChannelPhase::UnfundedInboundV2(_) => false,
925925 }
926926 )
@@ -2774,11 +2774,11 @@ macro_rules! convert_chan_phase_err {
27742774 ChannelPhase::UnfundedInboundV1(channel) => {
27752775 convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
27762776 },
2777- #[cfg(dual_funding)]
2777+ #[cfg(any( dual_funding, splicing) )]
27782778 ChannelPhase::UnfundedOutboundV2(channel) => {
27792779 convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
27802780 },
2781- #[cfg(dual_funding)]
2781+ #[cfg(any( dual_funding, splicing) )]
27822782 ChannelPhase::UnfundedInboundV2(channel) => {
27832783 convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
27842784 },
@@ -3653,8 +3653,8 @@ where
36533653 // Unfunded channel has no update
36543654 (None, chan_phase.context().get_counterparty_node_id())
36553655 },
3656- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
3657- #[cfg(dual_funding)]
3656+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
3657+ #[cfg(any( dual_funding, splicing) )]
36583658 ChannelPhase::UnfundedOutboundV2(_) | ChannelPhase::UnfundedInboundV2(_) => {
36593659 self.finish_close_channel(chan_phase.context_mut().force_shutdown(false, closure_reason));
36603660 // Unfunded channel has no update
@@ -5882,12 +5882,12 @@ where
58825882 process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
58835883 pending_msg_events, counterparty_node_id)
58845884 },
5885- #[cfg(dual_funding)]
5885+ #[cfg(any( dual_funding, splicing) )]
58865886 ChannelPhase::UnfundedInboundV2(chan) => {
58875887 process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
58885888 pending_msg_events, counterparty_node_id)
58895889 },
5890- #[cfg(dual_funding)]
5890+ #[cfg(any( dual_funding, splicing) )]
58915891 ChannelPhase::UnfundedOutboundV2(chan) => {
58925892 process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
58935893 pending_msg_events, counterparty_node_id)
@@ -7059,8 +7059,8 @@ where
70597059 num_unfunded_channels += 1;
70607060 }
70617061 },
7062- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
7063- #[cfg(dual_funding)]
7062+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
7063+ #[cfg(any( dual_funding, splicing) )]
70647064 ChannelPhase::UnfundedInboundV2(chan) => {
70657065 // Only inbound V2 channels that are not 0conf and that we do not contribute to will be
70667066 // included in the unfunded count.
@@ -7073,8 +7073,8 @@ where
70737073 // Outbound channels don't contribute to the unfunded count in the DoS context.
70747074 continue;
70757075 },
7076- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
7077- #[cfg(dual_funding)]
7076+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
7077+ #[cfg(any( dual_funding, splicing) )]
70787078 ChannelPhase::UnfundedOutboundV2(_) => {
70797079 // Outbound channels don't contribute to the unfunded count in the DoS context.
70807080 continue;
@@ -7501,7 +7501,7 @@ where
75017501 finish_shutdown = Some(chan.context_mut().force_shutdown(false, ClosureReason::CounterpartyCoopClosedUnfundedChannel));
75027502 },
75037503 // TODO(dual_funding): Combine this match arm with above.
7504- #[cfg(dual_funding)]
7504+ #[cfg(any( dual_funding, splicing) )]
75057505 ChannelPhase::UnfundedInboundV2(_) | ChannelPhase::UnfundedOutboundV2(_) => {
75067506 let context = phase.context_mut();
75077507 log_error!(self.logger, "Immediately closing unfunded channel {} as peer asked to cooperatively shut it down (which is unnecessary)", &msg.channel_id);
@@ -9450,7 +9450,7 @@ where
94509450 // Retain unfunded channels.
94519451 ChannelPhase::UnfundedOutboundV1(_) | ChannelPhase::UnfundedInboundV1(_) => true,
94529452 // TODO(dual_funding): Combine this match arm with above.
9453- #[cfg(dual_funding)]
9453+ #[cfg(any( dual_funding, splicing) )]
94549454 ChannelPhase::UnfundedOutboundV2(_) | ChannelPhase::UnfundedInboundV2(_) => true,
94559455 ChannelPhase::Funded(channel) => {
94569456 let res = f(channel);
@@ -9756,21 +9756,21 @@ where
97569756 msg.channel_id.clone())), *counterparty_node_id);
97579757 }
97589758
9759- #[cfg(dual_funding )]
9759+ #[cfg(splicing )]
97609760 fn handle_splice(&self, counterparty_node_id: &PublicKey, msg: &msgs::Splice) {
97619761 let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
97629762 "Splicing not supported".to_owned(),
97639763 msg.channel_id.clone())), *counterparty_node_id);
97649764 }
97659765
9766- #[cfg(dual_funding )]
9766+ #[cfg(splicing )]
97679767 fn handle_splice_ack(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceAck) {
97689768 let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
97699769 "Splicing not supported (splice_ack)".to_owned(),
97709770 msg.channel_id.clone())), *counterparty_node_id);
97719771 }
97729772
9773- #[cfg(dual_funding )]
9773+ #[cfg(splicing )]
97749774 fn handle_splice_locked(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceLocked) {
97759775 let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
97769776 "Splicing not supported (splice_locked)".to_owned(),
@@ -9928,11 +9928,11 @@ where
99289928 ChannelPhase::UnfundedInboundV1(chan) => {
99299929 &mut chan.context
99309930 },
9931- #[cfg(dual_funding)]
9931+ #[cfg(any( dual_funding, splicing) )]
99329932 ChannelPhase::UnfundedOutboundV2(chan) => {
99339933 &mut chan.context
99349934 },
9935- #[cfg(dual_funding)]
9935+ #[cfg(any( dual_funding, splicing) )]
99369936 ChannelPhase::UnfundedInboundV2(chan) => {
99379937 &mut chan.context
99389938 },
@@ -10093,8 +10093,8 @@ where
1009310093 });
1009410094 }
1009510095
10096- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
10097- #[cfg(dual_funding)]
10096+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
10097+ #[cfg(any( dual_funding, splicing) )]
1009810098 ChannelPhase::UnfundedOutboundV2(chan) => {
1009910099 pending_msg_events.push(events::MessageSendEvent::SendOpenChannelV2 {
1010010100 node_id: chan.context.get_counterparty_node_id(),
@@ -10109,8 +10109,8 @@ where
1010910109 debug_assert!(false);
1011010110 }
1011110111
10112- // TODO(dual_funding): Combine this match arm with above once #[cfg(dual_funding)] is removed.
10113- #[cfg(dual_funding)]
10112+ // TODO(dual_funding): Combine this match arm with above once #[cfg(any( dual_funding, splicing) )] is removed.
10113+ #[cfg(any( dual_funding, splicing) )]
1011410114 ChannelPhase::UnfundedInboundV2(channel) => {
1011510115 // Since unfunded inbound channel maps are cleared upon disconnecting a peer,
1011610116 // they are not persisted and won't be recovered after a crash.
@@ -10213,7 +10213,7 @@ where
1021310213 return;
1021410214 }
1021510215 },
10216- #[cfg(dual_funding)]
10216+ #[cfg(any( dual_funding, splicing) )]
1021710217 Some(ChannelPhase::UnfundedOutboundV2(ref mut chan)) => {
1021810218 if let Ok(msg) = chan.maybe_handle_error_without_close(self.chain_hash, &self.fee_estimator) {
1021910219 peer_state.pending_msg_events.push(events::MessageSendEvent::SendOpenChannelV2 {
@@ -10224,7 +10224,7 @@ where
1022410224 }
1022510225 },
1022610226 None | Some(ChannelPhase::UnfundedInboundV1(_) | ChannelPhase::Funded(_)) => (),
10227- #[cfg(dual_funding)]
10227+ #[cfg(any( dual_funding, splicing) )]
1022810228 Some(ChannelPhase::UnfundedInboundV2(_)) => (),
1022910229 }
1023010230 }
0 commit comments