Skip to content

Commit a50c9d0

Browse files
committed
fix: Share timeout-configured electrum client with ElectrumSyncClient
1 parent 243d179 commit a50c9d0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/chain/electrum.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,11 @@ impl ElectrumRuntimeClient {
404404
);
405405
let bdk_electrum_client = Arc::new(BdkElectrumClient::new(Arc::clone(&electrum_client)));
406406
let tx_sync = Arc::new(
407-
ElectrumSyncClient::new(server_url.clone(), Arc::clone(&logger)).map_err(|e| {
408-
log_error!(logger, "Failed to connect to electrum server: {}", e);
409-
Error::ConnectionFailed
410-
})?,
407+
ElectrumSyncClient::from_client(Arc::clone(&electrum_client), Arc::clone(&logger))
408+
.map_err(|e| {
409+
log_error!(logger, "Failed to create electrum sync client: {}", e);
410+
Error::ConnectionFailed
411+
})?,
411412
);
412413
Ok(Self {
413414
electrum_client,

0 commit comments

Comments
 (0)