@@ -927,9 +927,9 @@ impl <SP: Deref> PeerState<SP> where SP::Target: SignerProvider {
927
927
match phase {
928
928
ChannelPhase::Funded(_) | ChannelPhase::UnfundedOutboundV1(_) => true,
929
929
ChannelPhase::UnfundedInboundV1(_) => false,
930
- #[cfg(dual_funding)]
930
+ #[cfg(any( dual_funding, splicing) )]
931
931
ChannelPhase::UnfundedOutboundV2(_) => true,
932
- #[cfg(dual_funding)]
932
+ #[cfg(any( dual_funding, splicing) )]
933
933
ChannelPhase::UnfundedInboundV2(_) => false,
934
934
}
935
935
)
@@ -2791,11 +2791,11 @@ macro_rules! convert_chan_phase_err {
2791
2791
ChannelPhase::UnfundedInboundV1(channel) => {
2792
2792
convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
2793
2793
},
2794
- #[cfg(dual_funding)]
2794
+ #[cfg(any( dual_funding, splicing) )]
2795
2795
ChannelPhase::UnfundedOutboundV2(channel) => {
2796
2796
convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
2797
2797
},
2798
- #[cfg(dual_funding)]
2798
+ #[cfg(any( dual_funding, splicing) )]
2799
2799
ChannelPhase::UnfundedInboundV2(channel) => {
2800
2800
convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
2801
2801
},
@@ -3670,8 +3670,8 @@ where
3670
3670
// Unfunded channel has no update
3671
3671
(None, chan_phase.context().get_counterparty_node_id())
3672
3672
},
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) )]
3675
3675
ChannelPhase::UnfundedOutboundV2(_) | ChannelPhase::UnfundedInboundV2(_) => {
3676
3676
self.finish_close_channel(chan_phase.context_mut().force_shutdown(false, closure_reason));
3677
3677
// Unfunded channel has no update
@@ -5902,12 +5902,12 @@ where
5902
5902
process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
5903
5903
pending_msg_events, counterparty_node_id)
5904
5904
},
5905
- #[cfg(dual_funding)]
5905
+ #[cfg(any( dual_funding, splicing) )]
5906
5906
ChannelPhase::UnfundedInboundV2(chan) => {
5907
5907
process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
5908
5908
pending_msg_events, counterparty_node_id)
5909
5909
},
5910
- #[cfg(dual_funding)]
5910
+ #[cfg(any( dual_funding, splicing) )]
5911
5911
ChannelPhase::UnfundedOutboundV2(chan) => {
5912
5912
process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
5913
5913
pending_msg_events, counterparty_node_id)
@@ -7079,8 +7079,8 @@ where
7079
7079
num_unfunded_channels += 1;
7080
7080
}
7081
7081
},
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) )]
7084
7084
ChannelPhase::UnfundedInboundV2(chan) => {
7085
7085
// Only inbound V2 channels that are not 0conf and that we do not contribute to will be
7086
7086
// included in the unfunded count.
@@ -7093,8 +7093,8 @@ where
7093
7093
// Outbound channels don't contribute to the unfunded count in the DoS context.
7094
7094
continue;
7095
7095
},
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) )]
7098
7098
ChannelPhase::UnfundedOutboundV2(_) => {
7099
7099
// Outbound channels don't contribute to the unfunded count in the DoS context.
7100
7100
continue;
@@ -7521,7 +7521,7 @@ where
7521
7521
finish_shutdown = Some(chan.context_mut().force_shutdown(false, ClosureReason::CounterpartyCoopClosedUnfundedChannel));
7522
7522
},
7523
7523
// TODO(dual_funding): Combine this match arm with above.
7524
- #[cfg(dual_funding)]
7524
+ #[cfg(any( dual_funding, splicing) )]
7525
7525
ChannelPhase::UnfundedInboundV2(_) | ChannelPhase::UnfundedOutboundV2(_) => {
7526
7526
let context = phase.context_mut();
7527
7527
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
9474
9474
// Retain unfunded channels.
9475
9475
ChannelPhase::UnfundedOutboundV1(_) | ChannelPhase::UnfundedInboundV1(_) => true,
9476
9476
// TODO(dual_funding): Combine this match arm with above.
9477
- #[cfg(dual_funding)]
9477
+ #[cfg(any( dual_funding, splicing) )]
9478
9478
ChannelPhase::UnfundedOutboundV2(_) | ChannelPhase::UnfundedInboundV2(_) => true,
9479
9479
ChannelPhase::Funded(channel) => {
9480
9480
let res = f(channel);
@@ -9780,21 +9780,21 @@ where
9780
9780
msg.channel_id.clone())), *counterparty_node_id);
9781
9781
}
9782
9782
9783
- #[cfg(dual_funding )]
9783
+ #[cfg(splicing )]
9784
9784
fn handle_splice(&self, counterparty_node_id: &PublicKey, msg: &msgs::Splice) {
9785
9785
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
9786
9786
"Splicing not supported".to_owned(),
9787
9787
msg.channel_id.clone())), *counterparty_node_id);
9788
9788
}
9789
9789
9790
- #[cfg(dual_funding )]
9790
+ #[cfg(splicing )]
9791
9791
fn handle_splice_ack(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceAck) {
9792
9792
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
9793
9793
"Splicing not supported (splice_ack)".to_owned(),
9794
9794
msg.channel_id.clone())), *counterparty_node_id);
9795
9795
}
9796
9796
9797
- #[cfg(dual_funding )]
9797
+ #[cfg(splicing )]
9798
9798
fn handle_splice_locked(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceLocked) {
9799
9799
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
9800
9800
"Splicing not supported (splice_locked)".to_owned(),
@@ -9952,11 +9952,11 @@ where
9952
9952
ChannelPhase::UnfundedInboundV1(chan) => {
9953
9953
&mut chan.context
9954
9954
},
9955
- #[cfg(dual_funding)]
9955
+ #[cfg(any( dual_funding, splicing) )]
9956
9956
ChannelPhase::UnfundedOutboundV2(chan) => {
9957
9957
&mut chan.context
9958
9958
},
9959
- #[cfg(dual_funding)]
9959
+ #[cfg(any( dual_funding, splicing) )]
9960
9960
ChannelPhase::UnfundedInboundV2(chan) => {
9961
9961
&mut chan.context
9962
9962
},
@@ -10117,8 +10117,8 @@ where
10117
10117
});
10118
10118
}
10119
10119
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) )]
10122
10122
ChannelPhase::UnfundedOutboundV2(chan) => {
10123
10123
pending_msg_events.push(events::MessageSendEvent::SendOpenChannelV2 {
10124
10124
node_id: chan.context.get_counterparty_node_id(),
@@ -10133,8 +10133,8 @@ where
10133
10133
debug_assert!(false);
10134
10134
}
10135
10135
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) )]
10138
10138
ChannelPhase::UnfundedInboundV2(channel) => {
10139
10139
// Since unfunded inbound channel maps are cleared upon disconnecting a peer,
10140
10140
// they are not persisted and won't be recovered after a crash.
@@ -10237,7 +10237,7 @@ where
10237
10237
return;
10238
10238
}
10239
10239
},
10240
- #[cfg(dual_funding)]
10240
+ #[cfg(any( dual_funding, splicing) )]
10241
10241
Some(ChannelPhase::UnfundedOutboundV2(ref mut chan)) => {
10242
10242
if let Ok(msg) = chan.maybe_handle_error_without_close(self.chain_hash, &self.fee_estimator) {
10243
10243
peer_state.pending_msg_events.push(events::MessageSendEvent::SendOpenChannelV2 {
@@ -10248,7 +10248,7 @@ where
10248
10248
}
10249
10249
},
10250
10250
None | Some(ChannelPhase::UnfundedInboundV1(_) | ChannelPhase::Funded(_)) => (),
10251
- #[cfg(dual_funding)]
10251
+ #[cfg(any( dual_funding, splicing) )]
10252
10252
Some(ChannelPhase::UnfundedInboundV2(_)) => (),
10253
10253
}
10254
10254
}
0 commit comments