Skip to content
23 changes: 11 additions & 12 deletions lightning/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ pub enum FundingInfo {
/// The outpoint of the funding
outpoint: transaction::OutPoint,
},
/// The contributions used for a dual funding or splice funding transaction.
Contribution {
/// UTXOs spent as inputs contributed to the funding transaction.
inputs: Vec<OutPoint>,
/// Outputs contributed to the funding transaction.
outputs: Vec<TxOut>,
},
}

impl_writeable_tlv_based_enum!(FundingInfo,
Expand All @@ -85,6 +92,10 @@ impl_writeable_tlv_based_enum!(FundingInfo,
},
(1, OutPoint) => {
(1, outpoint, required)
},
(2, Contribution) => {
(1, inputs, optional_vec),
(3, outputs, optional_vec),
}
);

Expand Down Expand Up @@ -1561,10 +1572,6 @@ pub enum Event {
abandoned_funding_txo: Option<OutPoint>,
/// The features that this channel will operate with, if available.
channel_type: Option<ChannelTypeFeatures>,
/// UTXOs spent as inputs contributed to the splice transaction.
contributed_inputs: Vec<OutPoint>,
/// Outputs contributed to the splice transaction.
contributed_outputs: Vec<TxOut>,
},
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
/// inputs for another purpose.
Expand Down Expand Up @@ -2326,8 +2333,6 @@ impl Writeable for Event {
ref counterparty_node_id,
ref abandoned_funding_txo,
ref channel_type,
ref contributed_inputs,
ref contributed_outputs,
} => {
52u8.write(writer)?;
write_tlv_fields!(writer, {
Expand All @@ -2336,8 +2341,6 @@ impl Writeable for Event {
(5, user_channel_id, required),
(7, counterparty_node_id, required),
(9, abandoned_funding_txo, option),
(11, *contributed_inputs, optional_vec),
(13, *contributed_outputs, optional_vec),
});
},
// Note that, going forward, all new events must only write data inside of
Expand Down Expand Up @@ -2964,8 +2967,6 @@ impl MaybeReadable for Event {
(5, user_channel_id, required),
(7, counterparty_node_id, required),
(9, abandoned_funding_txo, option),
(11, contributed_inputs, optional_vec),
(13, contributed_outputs, optional_vec),
});

Ok(Some(Event::SpliceFailed {
Expand All @@ -2974,8 +2975,6 @@ impl MaybeReadable for Event {
counterparty_node_id: counterparty_node_id.0.unwrap(),
abandoned_funding_txo,
channel_type,
contributed_inputs: contributed_inputs.unwrap_or_default(),
contributed_outputs: contributed_outputs.unwrap_or_default(),
}))
};
f()
Expand Down
Loading
Loading