Move a handful of channel messages to notify-without-persist
authorMatt Corallo <git@bluematt.me>
Thu, 24 Aug 2023 19:36:58 +0000 (19:36 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 12 Sep 2023 19:06:34 +0000 (19:06 +0000)
commit71bafecafccbf35298f41149cd0153b72b8e786e
treea2474c6083f3821ce5d412450a87775bbaaa089a
parent305df1d7da1f23e60b7d06f2d8026e9dbcea35f4
Move a handful of channel messages to notify-without-persist

Many channel related messages don't actually change the channel
state in a way that changes the persisted channel. For example,
an `update_add_htlc` or `update_fail_htlc` message simply adds the
change to a queue, changing the channel state when we receive a
`commitment_signed` message.

In these cases there's really no reason to wake the background
processor at all - there's no response message and there's no state
update. However, note that if we close the channel we should
persist the `ChannelManager`. If we send an error message without
closing the channel, we should wake the background processor
without persisting.

Here we move to the appropriate `NotifyOption` on some of the
simpler channel message handlers.
lightning/src/ln/channelmanager.rs