Don't `per_peer_state` read locks recursively in monitor updating
authorMatt Corallo <git@bluematt.me>
Wed, 22 Feb 2023 22:10:46 +0000 (22:10 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 28 Feb 2023 01:06:35 +0000 (01:06 +0000)
commit2c8a26c6d23bb224d61b8fe605f961b3d08def87
tree728c2d3de9dc27e1d71f4c1ecc08feb75c030389
parent38374dde42991ec1829ac07033a313e883c4242e
Don't `per_peer_state` read locks recursively in monitor updating

When handling a `ChannelMonitor` update via the new
`handle_new_monitor_update` macro, we always call the macro with
the `per_peer_state` read lock held and have the macro drop the
per-peer state lock. Then, when handling the resulting updates, we
may take the `per_peer_state` read lock again in another function.

In a coming commit, recursive read locks will be disallowed, so we
have to drop the `per_peer_state` read lock before calling
additional functions in `handle_new_monitor_update`, which we do
here.
lightning/src/ln/channelmanager.rs