Cache fields instead of storing a ChannelKeys in ChannelMonitor
authorMatt Corallo <git@bluematt.me>
Fri, 30 Oct 2020 21:25:15 +0000 (17:25 -0400)
committerMatt Corallo <git@bluematt.me>
Mon, 4 Jan 2021 17:37:47 +0000 (12:37 -0500)
commitc5fca8c41cee0096eb529de4529f234b5047d326
tree4cd59a5cfda7d4d6286e4812548b314125a0014c
parent9c9c88147e6a8fa637dc048f764ab8ecfea200d4
Cache fields instead of storing a ChannelKeys in ChannelMonitor

We only actually use two of the fields in ChannelKeys inside a
ChannelMonitor - the holder revocation_basepoint and the
derivation parameters. Both are relatively small, so there isn't
a lot of reason to hold a full copy of the ChannelKeys (with most
of the interaction with it being inside the OnchainTxHandler).

Further, this will avoid calling read on a `ChannelKeys` twice,
which is a somewhat strange API quirk.
lightning/src/chain/channelmonitor.rs