@@ -918,9 +918,9 @@ impl <SP: Deref> PeerState<SP> where SP::Target: SignerProvider {
918
918
match phase {
919
919
ChannelPhase::Funded(_) | ChannelPhase::UnfundedOutboundV1(_) => true,
920
920
ChannelPhase::UnfundedInboundV1(_) => false,
921
- #[cfg(dual_funding)]
921
+ #[cfg(any( dual_funding, splicing) )]
922
922
ChannelPhase::UnfundedOutboundV2(_) => true,
923
- #[cfg(dual_funding)]
923
+ #[cfg(any( dual_funding, splicing) )]
924
924
ChannelPhase::UnfundedInboundV2(_) => false,
925
925
}
926
926
)
@@ -2774,11 +2774,11 @@ macro_rules! convert_chan_phase_err {
2774
2774
ChannelPhase::UnfundedInboundV1(channel) => {
2775
2775
convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
2776
2776
},
2777
- #[cfg(dual_funding)]
2777
+ #[cfg(any( dual_funding, splicing) )]
2778
2778
ChannelPhase::UnfundedOutboundV2(channel) => {
2779
2779
convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
2780
2780
},
2781
- #[cfg(dual_funding)]
2781
+ #[cfg(any( dual_funding, splicing) )]
2782
2782
ChannelPhase::UnfundedInboundV2(channel) => {
2783
2783
convert_chan_phase_err!($self, $err, channel, $channel_id, UNFUNDED_CHANNEL)
2784
2784
},
@@ -3653,8 +3653,8 @@ where
3653
3653
// Unfunded channel has no update
3654
3654
(None, chan_phase.context().get_counterparty_node_id())
3655
3655
},
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) )]
3658
3658
ChannelPhase::UnfundedOutboundV2(_) | ChannelPhase::UnfundedInboundV2(_) => {
3659
3659
self.finish_close_channel(chan_phase.context_mut().force_shutdown(false, closure_reason));
3660
3660
// Unfunded channel has no update
@@ -5882,12 +5882,12 @@ where
5882
5882
process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
5883
5883
pending_msg_events, counterparty_node_id)
5884
5884
},
5885
- #[cfg(dual_funding)]
5885
+ #[cfg(any( dual_funding, splicing) )]
5886
5886
ChannelPhase::UnfundedInboundV2(chan) => {
5887
5887
process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
5888
5888
pending_msg_events, counterparty_node_id)
5889
5889
},
5890
- #[cfg(dual_funding)]
5890
+ #[cfg(any( dual_funding, splicing) )]
5891
5891
ChannelPhase::UnfundedOutboundV2(chan) => {
5892
5892
process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context,
5893
5893
pending_msg_events, counterparty_node_id)
@@ -7059,8 +7059,8 @@ where
7059
7059
num_unfunded_channels += 1;
7060
7060
}
7061
7061
},
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) )]
7064
7064
ChannelPhase::UnfundedInboundV2(chan) => {
7065
7065
// Only inbound V2 channels that are not 0conf and that we do not contribute to will be
7066
7066
// included in the unfunded count.
@@ -7073,8 +7073,8 @@ where
7073
7073
// Outbound channels don't contribute to the unfunded count in the DoS context.
7074
7074
continue;
7075
7075
},
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) )]
7078
7078
ChannelPhase::UnfundedOutboundV2(_) => {
7079
7079
// Outbound channels don't contribute to the unfunded count in the DoS context.
7080
7080
continue;
@@ -7501,7 +7501,7 @@ where
7501
7501
finish_shutdown = Some(chan.context_mut().force_shutdown(false, ClosureReason::CounterpartyCoopClosedUnfundedChannel));
7502
7502
},
7503
7503
// TODO(dual_funding): Combine this match arm with above.
7504
- #[cfg(dual_funding)]
7504
+ #[cfg(any( dual_funding, splicing) )]
7505
7505
ChannelPhase::UnfundedInboundV2(_) | ChannelPhase::UnfundedOutboundV2(_) => {
7506
7506
let context = phase.context_mut();
7507
7507
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
9450
9450
// Retain unfunded channels.
9451
9451
ChannelPhase::UnfundedOutboundV1(_) | ChannelPhase::UnfundedInboundV1(_) => true,
9452
9452
// TODO(dual_funding): Combine this match arm with above.
9453
- #[cfg(dual_funding)]
9453
+ #[cfg(any( dual_funding, splicing) )]
9454
9454
ChannelPhase::UnfundedOutboundV2(_) | ChannelPhase::UnfundedInboundV2(_) => true,
9455
9455
ChannelPhase::Funded(channel) => {
9456
9456
let res = f(channel);
@@ -9756,21 +9756,21 @@ where
9756
9756
msg.channel_id.clone())), *counterparty_node_id);
9757
9757
}
9758
9758
9759
- #[cfg(dual_funding )]
9759
+ #[cfg(splicing )]
9760
9760
fn handle_splice(&self, counterparty_node_id: &PublicKey, msg: &msgs::Splice) {
9761
9761
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
9762
9762
"Splicing not supported".to_owned(),
9763
9763
msg.channel_id.clone())), *counterparty_node_id);
9764
9764
}
9765
9765
9766
- #[cfg(dual_funding )]
9766
+ #[cfg(splicing )]
9767
9767
fn handle_splice_ack(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceAck) {
9768
9768
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
9769
9769
"Splicing not supported (splice_ack)".to_owned(),
9770
9770
msg.channel_id.clone())), *counterparty_node_id);
9771
9771
}
9772
9772
9773
- #[cfg(dual_funding )]
9773
+ #[cfg(splicing )]
9774
9774
fn handle_splice_locked(&self, counterparty_node_id: &PublicKey, msg: &msgs::SpliceLocked) {
9775
9775
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
9776
9776
"Splicing not supported (splice_locked)".to_owned(),
@@ -9928,11 +9928,11 @@ where
9928
9928
ChannelPhase::UnfundedInboundV1(chan) => {
9929
9929
&mut chan.context
9930
9930
},
9931
- #[cfg(dual_funding)]
9931
+ #[cfg(any( dual_funding, splicing) )]
9932
9932
ChannelPhase::UnfundedOutboundV2(chan) => {
9933
9933
&mut chan.context
9934
9934
},
9935
- #[cfg(dual_funding)]
9935
+ #[cfg(any( dual_funding, splicing) )]
9936
9936
ChannelPhase::UnfundedInboundV2(chan) => {
9937
9937
&mut chan.context
9938
9938
},
@@ -10093,8 +10093,8 @@ where
10093
10093
});
10094
10094
}
10095
10095
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) )]
10098
10098
ChannelPhase::UnfundedOutboundV2(chan) => {
10099
10099
pending_msg_events.push(events::MessageSendEvent::SendOpenChannelV2 {
10100
10100
node_id: chan.context.get_counterparty_node_id(),
@@ -10109,8 +10109,8 @@ where
10109
10109
debug_assert!(false);
10110
10110
}
10111
10111
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) )]
10114
10114
ChannelPhase::UnfundedInboundV2(channel) => {
10115
10115
// Since unfunded inbound channel maps are cleared upon disconnecting a peer,
10116
10116
// they are not persisted and won't be recovered after a crash.
@@ -10213,7 +10213,7 @@ where
10213
10213
return;
10214
10214
}
10215
10215
},
10216
- #[cfg(dual_funding)]
10216
+ #[cfg(any( dual_funding, splicing) )]
10217
10217
Some(ChannelPhase::UnfundedOutboundV2(ref mut chan)) => {
10218
10218
if let Ok(msg) = chan.maybe_handle_error_without_close(self.chain_hash, &self.fee_estimator) {
10219
10219
peer_state.pending_msg_events.push(events::MessageSendEvent::SendOpenChannelV2 {
@@ -10224,7 +10224,7 @@ where
10224
10224
}
10225
10225
},
10226
10226
None | Some(ChannelPhase::UnfundedInboundV1(_) | ChannelPhase::Funded(_)) => (),
10227
- #[cfg(dual_funding)]
10227
+ #[cfg(any( dual_funding, splicing) )]
10228
10228
Some(ChannelPhase::UnfundedInboundV2(_)) => (),
10229
10229
}
10230
10230
}
0 commit comments