X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fevents%2Fmod.rs;h=36c0f20d2aed5d99f8183240d3332d67e0cd0130;hb=afdcd1c19880a0e982184fbb576b392b45e1c795;hp=a40a09fe512f4b25ca5ca530c909021adee9df7b;hpb=4a30d9e78a37b20b1d39e009ee3902649b21f65a;p=rust-lightning diff --git a/lightning/src/events/mod.rs b/lightning/src/events/mod.rs index a40a09fe..36c0f20d 100644 --- a/lightning/src/events/mod.rs +++ b/lightning/src/events/mod.rs @@ -715,6 +715,10 @@ pub enum Event { SpendableOutputs { /// The outputs which you should store as spendable by you. outputs: Vec, + /// The `channel_id` indicating which channel the spendable outputs belong to. + /// + /// This will always be `Some` for events generated by LDK versions 0.0.117 and above. + channel_id: Option<[u8; 32]>, }, /// This event is generated when a payment has been successfully forwarded through us and a /// forwarding fee earned. @@ -1000,10 +1004,11 @@ impl Writeable for Event { // Note that we now ignore these on the read end as we'll re-generate them in // ChannelManager, we write them here only for backwards compatibility. }, - &Event::SpendableOutputs { ref outputs } => { + &Event::SpendableOutputs { ref outputs, channel_id } => { 5u8.write(writer)?; write_tlv_fields!(writer, { (0, WithoutLength(outputs), required), + (1, channel_id, option), }); }, &Event::HTLCIntercepted { requested_next_hop_scid, payment_hash, inbound_amount_msat, expected_outbound_amount_msat, intercept_id } => { @@ -1274,10 +1279,12 @@ impl MaybeReadable for Event { 5u8 => { let f = || { let mut outputs = WithoutLength(Vec::new()); + let mut channel_id: Option<[u8; 32]> = None; read_tlv_fields!(reader, { (0, outputs, required), + (1, channel_id, option), }); - Ok(Some(Event::SpendableOutputs { outputs: outputs.0 })) + Ok(Some(Event::SpendableOutputs { outputs: outputs.0, channel_id })) }; f() },