Add an `optional_vec` TLV format which makes sense, unlike vec_type
authorMatt Corallo <git@bluematt.me>
Mon, 20 Mar 2023 23:24:56 +0000 (23:24 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 20 Mar 2023 23:29:22 +0000 (23:29 +0000)
commit85b573ddad70f3c5ee36e0992d587842af507a8d
tree6327e433343f25c900adef17711a64a1015c8e3b
parent23c1b461ea9c17a0bfd2be3825b1d761d38d6241
Add an `optional_vec` TLV format which makes sense, unlike vec_type

`vec_type` is confusing - it is happy to have a missing entry,
"reading" an empty `Vec` instead, but always writes something,
making a serialization round-trip different.

This is a problem for writing a new `Vec` which is
backwards-incompatible, but only if filled in. In that case we'd
really like the same read behavior, but not write anything if the
`Vec` is empty. Here we introduce such semantics via a new
`optional_vec` TLV format.
lightning/src/util/ser_macros.rs