Skip to content

Commit 3e8a17b

Browse files
committed
f Reuse the same esplora-client again
1 parent 2c45b8a commit 3e8a17b

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ rand = "0.8.5"
9292
chrono = { version = "0.4", default-features = false, features = ["clock"] }
9393
tokio = { version = "1.37", default-features = false, features = [ "rt-multi-thread", "time", "sync", "macros" ] }
9494
esplora-client = { version = "0.12", default-features = false, features = ["tokio", "async-https-rustls"] }
95-
96-
# FIXME: This was introduced to decouple the `bdk_esplora` and
97-
# `lightning-transaction-sync` APIs. We should drop it as part of the upgrade
98-
# to LDK 0.2.
99-
esplora-client_0_11 = { package = "esplora-client", version = "0.11", default-features = false, features = ["tokio", "async-https-rustls"] }
10095
electrum-client = { version = "0.23.1", default-features = true }
10196
libc = "0.2"
10297
uniffi = { version = "0.27.3", features = ["build"], optional = true }

src/chain/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,11 @@ impl ChainSource {
237237
kv_store: Arc<DynStore>, config: Arc<Config>, logger: Arc<Logger>,
238238
node_metrics: Arc<RwLock<NodeMetrics>>,
239239
) -> Self {
240-
// FIXME / TODO: We introduced this to make `bdk_esplora` work separately without updating
241-
// `lightning-transaction-sync`. We should revert this as part of of the upgrade to LDK 0.2.
242-
let mut client_builder_0_11 = esplora_client_0_11::Builder::new(&server_url);
243-
client_builder_0_11 = client_builder_0_11.timeout(DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS);
244-
let esplora_client_0_11 = client_builder_0_11.build_async().unwrap();
245-
let tx_sync =
246-
Arc::new(EsploraSyncClient::from_client(esplora_client_0_11, Arc::clone(&logger)));
247-
248240
let mut client_builder = esplora_client::Builder::new(&server_url);
249241
client_builder = client_builder.timeout(DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS);
250242
let esplora_client = client_builder.build_async().unwrap();
243+
let tx_sync =
244+
Arc::new(EsploraSyncClient::from_client(esplora_client.clone(), Arc::clone(&logger)));
251245

252246
let onchain_wallet_sync_status = Mutex::new(WalletSyncStatus::Completed);
253247
let lightning_wallet_sync_status = Mutex::new(WalletSyncStatus::Completed);

0 commit comments

Comments
 (0)