Skip to content

Commit 3136a05

Browse files
committed
Serialize startup chain source requests
When concurrent requests share an Electrum client connection, a clean EOF can cause the active reader to return an error without waking other requests waiting on the connection. Those requests remain blocked in spawn_blocking, causing Tokio runtime shutdown to wait indefinitely for them to finish. As a temporary fix, we run the startup fee update and zero-fee commitment validation in sequence. This avoids concurrent requests on the shared Electrum connection leaving a blocking task stranded after connection closure. Co-Authored-By: HAL 9000
1 parent 2da79df commit 3136a05

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,12 @@ impl Node {
347347
// TODO: drop 0FC chain source validation when support is ubiquitous
348348
let chain_source = Arc::clone(&self.chain_source);
349349
self.runtime.block_on(async move {
350-
tokio::try_join!(
351-
chain_source.update_fee_rate_estimates(),
352-
chain_source.validate_zero_fee_commitments_support_if_required(
353-
zero_fee_commitments_support_required
350+
chain_source.update_fee_rate_estimates().await?;
351+
chain_source
352+
.validate_zero_fee_commitments_support_if_required(
353+
zero_fee_commitments_support_required,
354354
)
355-
)
355+
.await
356356
})?;
357357

358358
// Bind listeners before spawning background tasks so startup errors cannot leave loops

0 commit comments

Comments
 (0)