@@ -58,10 +58,9 @@ use crate::ln::channelmanager::{
5858 BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT, MIN_CLTV_EXPIRY_DELTA,
5959};
6060use crate::ln::interactivetxs::{
61- calculate_change_output_value, get_output_weight, AbortReason, HandleTxCompleteResult,
62- InteractiveTxConstructor, InteractiveTxConstructorArgs, InteractiveTxMessageSend,
63- InteractiveTxMessageSendResult, InteractiveTxSigningSession, SharedOwnedInput,
64- SharedOwnedOutput, TX_COMMON_FIELDS_WEIGHT,
61+ calculate_change_output_value, get_output_weight, AbortReason, InteractiveTxConstructor,
62+ InteractiveTxConstructorArgs, InteractiveTxMessageSend, InteractiveTxSigningSession,
63+ SharedOwnedInput, SharedOwnedOutput, TX_COMMON_FIELDS_WEIGHT,
6564};
6665use crate::ln::msgs;
6766use crate::ln::msgs::{ClosingSigned, ClosingSignedFeeRange, DecodeError, OnionErrorPacket};
@@ -1734,11 +1733,11 @@ where
17341733 }
17351734 }
17361735
1737- pub fn as_negotiating_channel (&mut self) -> Option<NegotiatingChannelView > {
1736+ pub fn interactive_tx_constructor_mut (&mut self) -> Option<&mut InteractiveTxConstructor > {
17381737 match &mut self.phase {
1739- ChannelPhase::UnfundedV2(chan) => Some( chan.as_negotiating_channel() ),
1738+ ChannelPhase::UnfundedV2(chan) => chan.interactive_tx_constructor.as_mut( ),
17401739 #[cfg(splicing)]
1741- ChannelPhase::Funded(chan) => chan.as_renegotiating_channel (),
1740+ ChannelPhase::Funded(chan) => chan.interactive_tx_constructor_mut (),
17421741 _ => None,
17431742 }
17441743 }
@@ -2958,62 +2957,6 @@ where
29582957 }
29592958}
29602959
2961- /// A short-lived subset view of a channel, used for V2 funding negotiation or re-negotiation.
2962- /// Can be produced by:
2963- /// - [`PendingV2Channel`], at V2 channel open, and
2964- /// - [`FundedChannel`], when splicing.
2965- pub(super) struct NegotiatingChannelView<'a>(&'a mut InteractiveTxConstructor);
2966-
2967- impl<'a> NegotiatingChannelView<'a> {
2968- pub(super) fn tx_add_input(
2969- &mut self, msg: &msgs::TxAddInput,
2970- ) -> InteractiveTxMessageSendResult {
2971- InteractiveTxMessageSendResult(
2972- self.0
2973- .handle_tx_add_input(msg)
2974- .map_err(|reason| reason.into_tx_abort_msg(msg.channel_id)),
2975- )
2976- }
2977-
2978- pub(super) fn tx_add_output(
2979- &mut self, msg: &msgs::TxAddOutput,
2980- ) -> InteractiveTxMessageSendResult {
2981- InteractiveTxMessageSendResult(
2982- self.0
2983- .handle_tx_add_output(msg)
2984- .map_err(|reason| reason.into_tx_abort_msg(msg.channel_id)),
2985- )
2986- }
2987-
2988- pub(super) fn tx_remove_input(
2989- &mut self, msg: &msgs::TxRemoveInput,
2990- ) -> InteractiveTxMessageSendResult {
2991- InteractiveTxMessageSendResult(
2992- self.0
2993- .handle_tx_remove_input(msg)
2994- .map_err(|reason| reason.into_tx_abort_msg(msg.channel_id)),
2995- )
2996- }
2997-
2998- pub(super) fn tx_remove_output(
2999- &mut self, msg: &msgs::TxRemoveOutput,
3000- ) -> InteractiveTxMessageSendResult {
3001- InteractiveTxMessageSendResult(
3002- self.0
3003- .handle_tx_remove_output(msg)
3004- .map_err(|reason| reason.into_tx_abort_msg(msg.channel_id)),
3005- )
3006- }
3007-
3008- pub(super) fn tx_complete(&mut self, msg: &msgs::TxComplete) -> HandleTxCompleteResult {
3009- HandleTxCompleteResult(
3010- self.0
3011- .handle_tx_complete(msg)
3012- .map_err(|reason| reason.into_tx_abort_msg(msg.channel_id)),
3013- )
3014- }
3015- }
3016-
30172960impl<SP: Deref> ChannelContext<SP>
30182961where
30192962 SP::Target: SignerProvider,
@@ -6174,17 +6117,16 @@ where
61746117 self.context.force_shutdown(&self.funding, closure_reason)
61756118 }
61766119
6177- /// If we are in splicing/refunding, return a short-lived [`NegotiatingChannelView`].
61786120 #[cfg(splicing)]
6179- fn as_renegotiating_channel (&mut self) -> Option<NegotiatingChannelView > {
6121+ fn interactive_tx_constructor_mut (&mut self) -> Option<&mut InteractiveTxConstructor > {
61806122 self.pending_splice
61816123 .as_mut()
61826124 .and_then(|pending_splice| pending_splice.funding_negotiation.as_mut())
61836125 .and_then(|funding_negotiation| {
61846126 if let FundingNegotiation::Pending(_, interactive_tx_constructor) =
61856127 funding_negotiation
61866128 {
6187- Some(NegotiatingChannelView( interactive_tx_constructor) )
6129+ Some(interactive_tx_constructor)
61886130 } else {
61896131 None
61906132 }
@@ -12610,11 +12552,6 @@ where
1261012552 pub fn get_accept_channel_v2_message(&self) -> msgs::AcceptChannelV2 {
1261112553 self.generate_accept_channel_v2_message()
1261212554 }
12613-
12614- /// Return a short-lived [`NegotiatingChannelView`].
12615- fn as_negotiating_channel(&mut self) -> NegotiatingChannelView {
12616- NegotiatingChannelView(self.interactive_tx_constructor.as_mut().expect("TODO"))
12617- }
1261812555}
1261912556
1262012557// Unfunded channel utilities
0 commit comments