Skip to content

Commit 350a2b3

Browse files
committed
Call persist_graph after persist_manager
1 parent 3685a6c commit 350a2b3

File tree

1 file changed

+6
-5
lines changed
  • lightning-background-processor/src

1 file changed

+6
-5
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,16 @@ impl BackgroundProcessor {
290290
}
291291
}
292292

293+
// After we exit, ensure we persist the ChannelManager one final time - this avoids
294+
// some races where users quit while channel updates were in-flight, with
295+
// ChannelMonitor update(s) persisted without a corresponding ChannelManager update.
296+
persister.persist_manager(&*channel_manager)?;
297+
293298
// Persist NetworkGraph on exit
294299
if let Some(ref handler) = net_graph_msg_handler {
295300
persister.persist_graph(handler.network_graph())?;
296301
}
297-
298-
// After we exit, ensure we persist the ChannelManager one final time - this avoids
299-
// some races where users quit while channel updates were in-flight, with
300-
// ChannelMonitor update(s) persisted without a corresponding ChannelManager update.
301-
persister.persist_manager(&*channel_manager)
302+
Ok(())
302303
});
303304
Self { stop_thread: stop_thread_clone, thread_handle: Some(handle) }
304305
}

0 commit comments

Comments
 (0)