@@ -271,6 +271,10 @@ impl Node {
271271 loop {
272272 tokio:: select! {
273273 _ = stop_sync. changed( ) => {
274+ log_trace!(
275+ sync_logger,
276+ "Stopping background syncing on-chain wallet." ,
277+ ) ;
274278 return ;
275279 }
276280 _ = onchain_wallet_sync_interval. tick( ) => {
@@ -317,6 +321,10 @@ impl Node {
317321 loop {
318322 tokio:: select! {
319323 _ = stop_fee_updates. changed( ) => {
324+ log_trace!(
325+ fee_update_logger,
326+ "Stopping background updates of fee rate cache." ,
327+ ) ;
320328 return ;
321329 }
322330 _ = fee_rate_update_interval. tick( ) => {
@@ -364,6 +372,10 @@ impl Node {
364372 loop {
365373 tokio:: select! {
366374 _ = stop_sync. changed( ) => {
375+ log_trace!(
376+ sync_logger,
377+ "Stopping background syncing Lightning wallet." ,
378+ ) ;
367379 return ;
368380 }
369381 _ = wallet_sync_interval. tick( ) => {
@@ -416,6 +428,10 @@ impl Node {
416428 loop {
417429 tokio:: select! {
418430 _ = stop_gossip_sync. changed( ) => {
431+ log_trace!(
432+ gossip_sync_logger,
433+ "Stopping background syncing RGS gossip data." ,
434+ ) ;
419435 return ;
420436 }
421437 _ = interval. tick( ) => {
@@ -491,6 +507,10 @@ impl Node {
491507 let peer_mgr = Arc :: clone ( & peer_manager_connection_handler) ;
492508 tokio:: select! {
493509 _ = stop_listen. changed( ) => {
510+ log_trace!(
511+ listening_logger,
512+ "Stopping listening to inbound connections." ,
513+ ) ;
494514 break ;
495515 }
496516 res = listener. accept( ) => {
@@ -523,6 +543,10 @@ impl Node {
523543 loop {
524544 tokio:: select! {
525545 _ = stop_connect. changed( ) => {
546+ log_trace!(
547+ connect_logger,
548+ "Stopping reconnecting known peers." ,
549+ ) ;
526550 return ;
527551 }
528552 _ = interval. tick( ) => {
@@ -568,6 +592,10 @@ impl Node {
568592 loop {
569593 tokio:: select! {
570594 _ = stop_bcast. changed( ) => {
595+ log_trace!(
596+ bcast_logger,
597+ "Stopping broadcasting node announcements." ,
598+ ) ;
571599 return ;
572600 }
573601 _ = interval. tick( ) => {
@@ -624,13 +652,18 @@ impl Node {
624652
625653 let mut stop_tx_bcast = self . stop_sender . subscribe ( ) ;
626654 let tx_bcaster = Arc :: clone ( & self . tx_broadcaster ) ;
655+ let tx_bcast_logger = Arc :: clone ( & self . logger ) ;
627656 runtime. spawn ( async move {
628657 // Every second we try to clear our broadcasting queue.
629658 let mut interval = tokio:: time:: interval ( Duration :: from_secs ( 1 ) ) ;
630659 interval. set_missed_tick_behavior ( tokio:: time:: MissedTickBehavior :: Skip ) ;
631660 loop {
632661 tokio:: select! {
633662 _ = stop_tx_bcast. changed( ) => {
663+ log_trace!(
664+ tx_bcast_logger,
665+ "Stopping broadcasting transactions." ,
666+ ) ;
634667 return ;
635668 }
636669 _ = interval. tick( ) => {
@@ -673,11 +706,17 @@ impl Node {
673706 let background_error_logger = Arc :: clone ( & self . logger ) ;
674707 let background_scorer = Arc :: clone ( & self . scorer ) ;
675708 let stop_bp = self . stop_sender . subscribe ( ) ;
709+ let sleeper_logger = Arc :: clone ( & self . logger ) ;
676710 let sleeper = move |d| {
677711 let mut stop = stop_bp. clone ( ) ;
712+ let sleeper_logger = Arc :: clone ( & sleeper_logger) ;
678713 Box :: pin ( async move {
679714 tokio:: select! {
680715 _ = stop. changed( ) => {
716+ log_trace!(
717+ sleeper_logger,
718+ "Stopping processing events." ,
719+ ) ;
681720 true
682721 }
683722 _ = tokio:: time:: sleep( d) => {
@@ -687,6 +726,7 @@ impl Node {
687726 } )
688727 } ;
689728
729+ let background_stop_logger = Arc :: clone ( & self . logger ) ;
690730 runtime. spawn ( async move {
691731 process_events_async (
692732 background_persister,
@@ -706,15 +746,21 @@ impl Node {
706746 log_error ! ( background_error_logger, "Failed to process events: {}" , e) ;
707747 panic ! ( "Failed to process events" ) ;
708748 } ) ;
749+ log_trace ! ( background_stop_logger, "Events processing stopped." , ) ;
709750 } ) ;
710751
711752 if let Some ( liquidity_source) = self . liquidity_source . as_ref ( ) {
712753 let mut stop_liquidity_handler = self . stop_sender . subscribe ( ) ;
713754 let liquidity_handler = Arc :: clone ( & liquidity_source) ;
755+ let liquidity_logger = Arc :: clone ( & self . logger ) ;
714756 runtime. spawn ( async move {
715757 loop {
716758 tokio:: select! {
717759 _ = stop_liquidity_handler. changed( ) => {
760+ log_trace!(
761+ liquidity_logger,
762+ "Stopping processing liquidity events." ,
763+ ) ;
718764 return ;
719765 }
720766 _ = liquidity_handler. handle_next_event( ) => { }
0 commit comments