Skip to content

Commit e7aa793

Browse files
committed
f - populate SpliceFailed inputs and outputs
1 parent be6b7a5 commit e7aa793

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ where
17191719
L::Target: Logger,
17201720
{
17211721
let logger = WithChannelContext::from(logger, &self.context(), None);
1722-
let NegotiationError { reason, .. } = error;
1722+
let NegotiationError { reason, contributed_inputs, contributed_outputs } = error;
17231723
log_info!(logger, "Failed interactive transaction negotiation: {reason}");
17241724

17251725
let splice_funding_failed = match &mut self.phase {
@@ -1736,15 +1736,23 @@ where
17361736
.and_then(|pending_splice| pending_splice.funding_negotiation.take())
17371737
.filter(|funding_negotiation| funding_negotiation.is_initiator())
17381738
.map(|funding_negotiation| {
1739-
let funding = funding_negotiation.as_funding();
1739+
let funding_txo = funding_negotiation
1740+
.as_funding()
1741+
.and_then(|funding| funding.get_funding_txo())
1742+
.map(|txo| txo.into_bitcoin_outpoint());
1743+
1744+
let channel_type = funding_negotiation
1745+
.as_funding()
1746+
.map(|funding| funding.get_channel_type().clone());
1747+
17401748
SpliceFundingFailed {
17411749
channel_id: funded_channel.context.channel_id,
17421750
counterparty_node_id: funded_channel.context.counterparty_node_id,
17431751
user_channel_id: funded_channel.context.user_id,
1744-
funding_txo: funding.as_ref().and_then(|funding| funding.get_funding_txo()).map(|txo| txo.into_bitcoin_outpoint()),
1745-
channel_type: funding.as_ref().map(|funding| funding.get_channel_type().clone()),
1746-
contributed_inputs: Vec::new(),
1747-
contributed_outputs: Vec::new(),
1752+
funding_txo,
1753+
channel_type,
1754+
contributed_inputs,
1755+
contributed_outputs,
17481756
}
17491757
})
17501758
},

0 commit comments

Comments
 (0)