]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Don't immediately exit BP if `ChannelManager` is persistable
authorMatt Corallo <git@bluematt.me>
Mon, 3 Apr 2023 20:11:30 +0000 (20:11 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 4 Apr 2023 20:59:56 +0000 (20:59 +0000)
If `ChannelManager` is persistable before the async background
processor even starts, it may not even get around to overwriting
the `should_exit` flag before testing it, and the default value is
(incorrectly) true, causing an immediate unconditional exit.

The default value should simply be false.

Fixes #2140

lightning-background-processor/src/lib.rs

index c30e5ad667652cba466e8243b5558e6d42115b3a..3dd099b495de24085d1548eee3df60a1a9e3c93a 100644 (file)
@@ -518,7 +518,7 @@ where
        UMH::Target: 'static + CustomMessageHandler,
        PS::Target: 'static + Persister<'a, CW, T, ES, NS, SP, F, R, L, SC>,
 {
-       let mut should_break = true;
+       let mut should_break = false;
        let async_event_handler = |event| {
                let network_graph = gossip_sync.network_graph();
                let event_handler = &event_handler;