]> git.bitcoin.ninja Git - rust-lightning/commit
Move channel restoration after monitor update to a two-part macro
authorMatt Corallo <git@bluematt.me>
Fri, 20 Nov 2020 19:29:33 +0000 (14:29 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 1 Mar 2021 02:03:18 +0000 (21:03 -0500)
commitf5451ec78458ed07f978014b031dc6dfe3a9620e
tree023c41504c616dab769671d0b2d357139e0b4f8b
parent6d99c89959aece4f32bfb8e891720fdfeeb249ee
Move channel restoration after monitor update to a two-part macro

The channel restoration code in channel monitor updating and peer
reconnection both do incredibly similar things, and there is
little reason to have them be separate. Sadly because they require
holding a lock with a reference to elements in the lock, its not
practical to make them utility functions, so instead we introduce
a two-step macro here which will eventually be used for both.

Because we still support pre-NLL Rust, the macro has to be in two
parts - one which runs with the channel_state lock, and one which
does not.
lightning/src/ln/channelmanager.rs