]> git.bitcoin.ninja Git - rust-lightning/commit
Ensure `ChannelMonitorUpdate`s are ordered with full monitor writes 2024-07-monitor-ordering
authorMatt Corallo <git@bluematt.me>
Sat, 20 Jul 2024 22:57:09 +0000 (22:57 +0000)
committerMatt Corallo <git@bluematt.me>
Sat, 20 Jul 2024 23:05:46 +0000 (23:05 +0000)
commit036c31c9d0b6a243fa33aa5f8d5148d2ca065617
treefb781ef9b447c7559301dc3c2cd6d536bf9c8a7a
parent9ce3dd5269fdfd4e44dcdeed8f4733a23ec9dc1a
Ensure `ChannelMonitorUpdate`s are ordered with full monitor writes

When we update a channel, then while connecting a block persist a
full `ChannelMonitor` prior to persisting the
`ChannelMonitorUpdate`, users can end up seeing a full
`ChannelMonitor` with a given `latest_update_id` prior to seeing
the `ChannelMonitorUpdate` with the same `update_id`. This
could cause users to have a full `ChannelMonitor` on disk as well
as a `ChannelMonitorUpdate` which was already applied. While this
isn't an issue for the LDK-provided update-based `Persist`, its
somewhat surprising for users so we avoid it.
lightning/src/chain/chainmonitor.rs