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 @@ -238,7 +238,7 @@ impl BackgroundProcessor {
238238 // Exit the loop if the background processor was requested to stop.
239239 if stop_thread. load ( Ordering :: Acquire ) == true {
240240 log_trace ! ( logger, "Terminating background processor." ) ;
241- return Ok ( ( ) ) ;
241+ break ;
242242 }
243243 if last_freshness_call. elapsed ( ) . as_secs ( ) > FRESHNESS_TIMER {
244244 log_trace ! ( logger, "Calling ChannelManager's timer_tick_occurred" ) ;
@@ -280,6 +280,10 @@ impl BackgroundProcessor {
280280 }
281281 }
282282 }
283+ // After we exit, ensure we persist the ChannelManager one final time - this avoids
284+ // some races where users quit while channel updates were in-flight, with
285+ // ChannelMonitor update(s) persisted without a corresponding ChannelManager update.
286+ persister. persist_manager ( & * channel_manager)
283287 } ) ;
284288 Self { stop_thread : stop_thread_clone, thread_handle : Some ( handle) }
285289 }
You can’t perform that action at this time.
0 commit comments