]> git.bitcoin.ninja Git - rust-lightning/commit
Append backwards-compat TLVs to serialization of larger structs
authorMatt Corallo <git@bluematt.me>
Wed, 5 May 2021 22:56:42 +0000 (22:56 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 25 May 2021 20:06:45 +0000 (20:06 +0000)
commita515eb3ba6bf9a73db0a8a26774c83561153fb5a
tree6da8121a2a191f266bc349fd6afec7b8a7b1f59a
parentf8450a7c2cd6d31b0691e771c1b36ea857c26c2a
Append backwards-compat TLVs to serialization of larger structs

Currently our serialization is very compact, and contains version
numbers to indicate which versions the code can read a given
serialized struct. However, if you want to add a new field without
needlessly breaking the ability of previous versions of the code to
read the struct, there is not a good way to do so.

This adds dummy, currently empty, TLVs to the major structs we
serialize out for users, providing an easy place to put new
optional fields without breaking previous versions.
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/onchaintx.rs
lightning/src/util/ser_macros.rs