Ensure `Event::BumpTransaction` is forwards-compatible
authorMatt Corallo <git@bluematt.me>
Wed, 7 Dec 2022 00:41:07 +0000 (00:41 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 7 Dec 2022 23:17:58 +0000 (23:17 +0000)
`Event`s with an odd type are ignored by older versions of LDK,
however they rely on the `write_tlv_fields` call to know how many
bytes to read and discard. We were missing that call in our writing
of `Event::BumpTransaction`, which we add here.

lightning/src/util/events.rs

index 2c7e5413dafff9d9f027eab116d0967faae6ed2e..375174f6f6afa86c556c6804586adfa52020844a 100644 (file)
@@ -1125,6 +1125,7 @@ impl Writeable for Event {
                                        BumpTransactionEvent::ChannelClose { .. } => {}
                                        BumpTransactionEvent::HTLCResolution { .. } => {}
                                }
+                               write_tlv_fields!(writer, {}); // Write a length field for forwards compat
                        }
                        &Event::ChannelReady { ref channel_id, ref user_channel_id, ref counterparty_node_id, ref channel_type } => {
                                29u8.write(writer)?;