Remove redundant locking when creating `WithChannelMonitor` 2023-12-2314-cleanups-1
authorMatt Corallo <git@bluematt.me>
Sun, 3 Dec 2023 19:51:24 +0000 (19:51 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 3 Dec 2023 20:06:18 +0000 (20:06 +0000)
commit4f0d5ede3672a0dc620ba48236fd4719d7a186e4
tree69358dd6902691b8a0ad2244cd9375c9597384e1
parented75ce35ab80defe8cef71248d1d55ffbe8b280f
Remove redundant locking when creating `WithChannelMonitor`

The `WithChannelMonitor` log decorator redundantly locks the
`ChannelMonitor` inner mutex, which we fix here, as well as add a
new constructor which avoids locking at all if an inner mutex lock
is already readily available.
lightning/src/chain/channelmonitor.rs