@@ -1722,56 +1722,34 @@ where
1722
1722
let NegotiationError { reason, .. } = error;
1723
1723
log_info!(logger, "Failed interactive transaction negotiation: {reason}");
1724
1724
1725
- let mut splice_failed = None;
1726
-
1727
- let _interactive_tx_constructor = match &mut self.phase {
1725
+ let splice_funding_failed = match &mut self.phase {
1728
1726
ChannelPhase::Undefined => unreachable!(),
1729
1727
ChannelPhase::UnfundedOutboundV1(_) | ChannelPhase::UnfundedInboundV1(_) => None,
1730
1728
ChannelPhase::UnfundedV2(pending_v2_channel) => {
1731
- pending_v2_channel.interactive_tx_constructor.take()
1729
+ pending_v2_channel.interactive_tx_constructor.take();
1730
+ None
1732
1731
},
1733
1732
ChannelPhase::Funded(funded_channel) => {
1734
- if let Some(pending_splice) = funded_channel.pending_splice.as_mut() {
1735
- if pending_splice.funding_negotiation.is_some() {
1736
- let funding_negotiation = pending_splice.funding_negotiation.take();
1737
-
1738
- let (funding_txo, channel_type, contributed_inputs, contributed_outputs) =
1739
- if let Some(FundingNegotiation::ConstructingTransaction { funding, interactive_tx_constructor: _ }) = &funding_negotiation {
1740
- (
1741
- funding.get_funding_txo().map(|txo| txo.into_bitcoin_outpoint()),
1742
- Some(funding.get_channel_type().clone()),
1743
- Vec::new(), // TODO: Extract contributed inputs from interactive_tx_constructor
1744
- Vec::new(), // TODO: Extract contributed outputs from interactive_tx_constructor
1745
- )
1746
- } else {
1747
- (None, None, Vec::new(), Vec::new())
1748
- };
1749
-
1750
- splice_failed = Some(SpliceFundingFailed {
1733
+ funded_channel
1734
+ .pending_splice
1735
+ .as_mut()
1736
+ .and_then(|pending_splice| pending_splice.funding_negotiation.take())
1737
+ .map(|funding_negotiation| {
1738
+ let funding = funding_negotiation.as_funding();
1739
+ SpliceFundingFailed {
1751
1740
channel_id: funded_channel.context.channel_id,
1752
1741
counterparty_node_id: funded_channel.context.counterparty_node_id,
1753
1742
user_channel_id: funded_channel.context.user_id,
1754
- funding_txo,
1755
- channel_type,
1756
- contributed_inputs,
1757
- contributed_outputs,
1758
- });
1759
-
1760
- if let Some(FundingNegotiation::ConstructingTransaction { interactive_tx_constructor, .. }) = funding_negotiation {
1761
- Some(interactive_tx_constructor)
1762
- } else {
1763
- None
1743
+ funding_txo: funding.as_ref().and_then(|funding| funding.get_funding_txo()).map(|txo| txo.into_bitcoin_outpoint()),
1744
+ channel_type: funding.as_ref().map(|funding| funding.get_channel_type().clone()),
1745
+ contributed_inputs: Vec::new(),
1746
+ contributed_outputs: Vec::new(),
1764
1747
}
1765
- } else {
1766
- None
1767
- }
1768
- } else {
1769
- None
1770
- }
1748
+ })
1771
1749
},
1772
1750
};
1773
1751
1774
- (reason.into_tx_abort_msg(self.context().channel_id), splice_failed )
1752
+ (reason.into_tx_abort_msg(self.context().channel_id), splice_funding_failed )
1775
1753
}
1776
1754
1777
1755
pub fn tx_add_input<L: Deref>(
0 commit comments