File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
lightning-background-processor/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ impl BackgroundProcessor {
232232 // Exit the loop if the background processor was requested to stop.
233233 if stop_thread. load ( Ordering :: Acquire ) == true {
234234 log_trace ! ( logger, "Terminating background processor." ) ;
235- return Ok ( ( ) ) ;
235+ break ;
236236 }
237237 if last_freshness_call. elapsed ( ) . as_secs ( ) > FRESHNESS_TIMER {
238238 log_trace ! ( logger, "Calling ChannelManager's timer_tick_occurred" ) ;
@@ -269,6 +269,10 @@ impl BackgroundProcessor {
269269 }
270270 }
271271 }
272+ // After we exit, ensure we persist the ChannelManager one final time - this avoids
273+ // some races where users quit while channel updates were in-flight, with
274+ // ChannelMonitor update(s) persisted without a corresponding ChannelManager update.
275+ persister. persist_manager ( & * channel_manager)
272276 } ) ;
273277 Self { stop_thread : stop_thread_clone, thread_handle : Some ( handle) }
274278 }
You can’t perform that action at this time.
0 commit comments