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