@@ -1913,30 +1913,32 @@ where
1913
1913
.and_then(|pending_splice| pending_splice.funding_negotiation.take());
1914
1914
1915
1915
let should_ack = funding_negotiation_opt.is_some();
1916
- let splice_funding_failed = funding_negotiation_opt.map(|funding_negotiation| {
1917
- // Create SpliceFundingFailed for the aborted splice
1918
- let (funding_txo, channel_type) = match &funding_negotiation {
1919
- FundingNegotiation::ConstructingTransaction { funding, .. } => {
1920
- (funding.get_funding_txo().map(|txo| txo.into_bitcoin_outpoint()), Some(funding.get_channel_type().clone()))
1921
- },
1922
- FundingNegotiation::AwaitingSignatures { funding } => {
1923
- (funding.get_funding_txo().map(|txo| txo.into_bitcoin_outpoint()), Some(funding.get_channel_type().clone()))
1924
- },
1925
- FundingNegotiation::AwaitingAck { .. } => {
1926
- (None, None)
1927
- },
1928
- };
1916
+ let splice_funding_failed = funding_negotiation_opt
1917
+ .filter(|funding_negotiation| funding_negotiation.is_initiator())
1918
+ .map(|funding_negotiation| {
1919
+ // Create SpliceFundingFailed for the aborted splice
1920
+ let (funding_txo, channel_type) = match &funding_negotiation {
1921
+ FundingNegotiation::ConstructingTransaction { funding, .. } => {
1922
+ (funding.get_funding_txo().map(|txo| txo.into_bitcoin_outpoint()), Some(funding.get_channel_type().clone()))
1923
+ },
1924
+ FundingNegotiation::AwaitingSignatures { funding, .. } => {
1925
+ (funding.get_funding_txo().map(|txo| txo.into_bitcoin_outpoint()), Some(funding.get_channel_type().clone()))
1926
+ },
1927
+ FundingNegotiation::AwaitingAck { .. } => {
1928
+ (None, None)
1929
+ },
1930
+ };
1929
1931
1930
- SpliceFundingFailed {
1931
- channel_id: funded_channel.context.channel_id,
1932
- counterparty_node_id: funded_channel.context.counterparty_node_id,
1933
- user_channel_id: funded_channel.context.user_id,
1934
- funding_txo,
1935
- channel_type,
1936
- contributed_inputs: Vec::new(),
1937
- contributed_outputs: Vec::new(),
1938
- }
1939
- });
1932
+ SpliceFundingFailed {
1933
+ channel_id: funded_channel.context.channel_id,
1934
+ counterparty_node_id: funded_channel.context.counterparty_node_id,
1935
+ user_channel_id: funded_channel.context.user_id,
1936
+ funding_txo,
1937
+ channel_type,
1938
+ contributed_inputs: Vec::new(),
1939
+ contributed_outputs: Vec::new(),
1940
+ }
1941
+ });
1940
1942
(should_ack, splice_funding_failed)
1941
1943
},
1942
1944
};
0 commit comments