Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/scoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn setup_background_pathfinding_scores_sync(

let logger = Arc::clone(&logger);

runtime.spawn_background_processor_task(async move {
runtime.spawn_background_task(async move {
let mut interval = tokio::time::interval(EXTERNAL_PATHFINDING_SCORES_SYNC_INTERVAL);
loop {
tokio::select! {
Expand Down
20 changes: 20 additions & 0 deletions tests/integration_tests_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,26 @@ async fn start_stop_reinit() {
reinitialized_node.stop().unwrap();
}

// The scores-sync task runs alongside LDK's background processor, which claims the runtime's
// single background-processor slot; startup must not panic with both configured.
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn start_stop_with_pathfinding_scores_sync() {
let (_bitcoind, electrsd) = setup_bitcoind_and_electrsd();
let config = random_config(true);

let esplora_url = format!("http://{}", electrsd.esplora_url.as_ref().unwrap());

let mut sync_config = EsploraSyncConfig::default();
sync_config.background_sync_config = None;
setup_builder!(builder, config.node_config);
builder.set_chain_source_esplora(esplora_url.clone(), Some(sync_config));
builder.set_pathfinding_scores_source(esplora_url);

let node = builder.build(config.node_entropy.into()).unwrap();
node.start().unwrap();
node.stop().unwrap();
}

#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn onchain_send_receive() {
let (bitcoind, electrsd) = setup_bitcoind_and_electrsd();
Expand Down
Loading