Make `DataLossProtect` fields required and remove wrappers
authorDuncan Dean <git@dunxen.dev>
Mon, 1 May 2023 20:23:20 +0000 (22:23 +0200)
committerDuncan Dean <git@dunxen.dev>
Mon, 1 May 2023 20:41:12 +0000 (22:41 +0200)
commit16d0f2ff4a4dd968f30e1fbbf938a332267ddcf2
treecbb9571c9419d4adc85459a1ce274727c5883aea
parent0e8da588954abc32c2a341cedf888ee00f918183
Make `DataLossProtect` fields required and remove wrappers

The fields provided by `DataLossProtect` have been mandatory since
https://github.com/lightning/bolts/pull/754/commits/6656b70, regardless
of whether `option_dataloss_protect` or `option_remote_key` feature bits
are set.

We move the fields out of `DataLossProtect` to make encoding definitions
more succinct with `impl_writeable_msg!` and to reduce boilerplate.

This paves the way for completely removing `OptionalField` in subsequent
commits.
lightning/src/ln/channel.rs
lightning/src/ln/msgs.rs