Remove `OptionalField` and move `shutdown_scriptpubkey` into TLV stream
authorDuncan Dean <git@dunxen.dev>
Mon, 1 May 2023 20:52:30 +0000 (22:52 +0200)
committerDuncan Dean <git@dunxen.dev>
Tue, 2 May 2023 08:24:16 +0000 (10:24 +0200)
commit20cd856aa5d2834a557663ea67ee0139ad522586
treee565abb734994c3bddf9cbce87ce4d60d8c86d71
parent16d0f2ff4a4dd968f30e1fbbf938a332267ddcf2
Remove `OptionalField` and move `shutdown_scriptpubkey` into TLV stream

As pointed out in https://github.com/lightning/bolts/pull/754/commits/6656b70,
we can move the `shutdown_scriptpubkey` field into the TLV streams of
`OpenChannel` and `AcceptChannel` without affecting the resulting encoding.

We use `WithoutLength` encoding here to ensure that we do not encode a
length prefix along with `Script` as is normally the case.
lightning/src/ln/channel.rs
lightning/src/ln/msgs.rs
lightning/src/ln/shutdown_tests.rs
lightning/src/util/ser.rs
lightning/src/util/ser_macros.rs