File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ pub fn setup_background_pathfinding_scores_sync(
2626
2727 let logger = Arc :: clone ( & logger) ;
2828
29- runtime. spawn_background_processor_task ( async move {
29+ runtime. spawn_cancellable_background_task ( async move {
3030 let mut interval = tokio:: time:: interval ( EXTERNAL_PATHFINDING_SCORES_SYNC_INTERVAL ) ;
3131 loop {
3232 tokio:: select! {
Original file line number Diff line number Diff line change @@ -676,6 +676,26 @@ async fn start_stop_reinit() {
676676 reinitialized_node. stop ( ) . unwrap ( ) ;
677677}
678678
679+ // The scores-sync task runs alongside LDK's background processor, which claims the runtime's
680+ // single background-processor slot; startup must not panic with both configured.
681+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
682+ async fn start_stop_with_pathfinding_scores_sync ( ) {
683+ let ( _bitcoind, electrsd) = setup_bitcoind_and_electrsd ( ) ;
684+ let config = random_config ( ) ;
685+
686+ let esplora_url = format ! ( "http://{}" , electrsd. esplora_url. as_ref( ) . unwrap( ) ) ;
687+
688+ let mut sync_config = EsploraSyncConfig :: default ( ) ;
689+ sync_config. background_sync_config = None ;
690+ setup_builder ! ( builder, config. node_config) ;
691+ builder. set_chain_source_esplora ( esplora_url. clone ( ) , Some ( sync_config) ) ;
692+ builder. set_pathfinding_scores_source ( esplora_url) ;
693+
694+ let node = builder. build ( config. node_entropy . into ( ) ) . unwrap ( ) ;
695+ node. start ( ) . unwrap ( ) ;
696+ node. stop ( ) . unwrap ( ) ;
697+ }
698+
679699#[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
680700async fn onchain_send_receive ( ) {
681701 let ( bitcoind, electrsd) = setup_bitcoind_and_electrsd ( ) ;
You can’t perform that action at this time.
0 commit comments