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>
Thu, 20 May 2021 21:18:35 +0000 (21:18 +0000)
commite02accf0b5fb58fe62dd7bb281c90243139ab092
treec9bdec3721abf6908b7a3944fca5bff201f7b3cf
parent45ccf688577805df28d6a7adffed86c8472439a9
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