Ignore .tmp files when loading ChannelMonitors in persister 2022-02-persister-ignore-tmp
authorMatt Corallo <git@bluematt.me>
Wed, 23 Feb 2022 22:06:33 +0000 (22:06 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 24 Feb 2022 19:09:44 +0000 (19:09 +0000)
commita2a90ee959ee5bd1b653ea5c0ef22bf1ef7bb3f8
tree8e1323afb56e0f7d5bf2b739f0fa687749fe91bb
parente43cfe135a5b68620cd51b9b982362c272b4ef77
Ignore .tmp files when loading ChannelMonitors in persister

If we are in the middle of persisting an update to a
`ChannelMonitor` when we shutdown (or crash), we'll start up with
a .tmp file lying around. We should ignore it, as failure to
return from the update call should have prevented the
`ChannelManager` from taking any irrevocable action based on the
update.

We're somewhat protected from any filesystem inconsistency behavior
as the `ChannelManager` will refuse to load if we're outright
missing `ChannelMonitor`s.

Fixes #1330.
lightning-persister/src/lib.rs