Skip to content

Commit 2e7acb2

Browse files
committed
f Use futures' Mutex rather than tokio's
1 parent 5d94cb6 commit 2e7acb2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lightning-transaction-sync/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ rustdoc-args = ["--cfg", "docsrs"]
1515

1616
[features]
1717
default = ["esplora-blocking"]
18-
esplora-async = ["async-interface", "esplora-client/async", "tokio"]
18+
esplora-async = ["async-interface", "esplora-client/async", "futures"]
1919
esplora-blocking = ["esplora-client/blocking"]
2020
async-interface = []
2121

2222
[dependencies]
2323
lightning = { version = "0.0.112", path = "../lightning" }
2424
bitcoin = "0.29.0"
2525
bdk-macros = "0.6"
26-
tokio = { version = "1.0", default-features = false, features = [], optional = true }
26+
futures = { version = "0.3", optional = true }
2727
esplora-client = { git = "https://github.com/tnull/rust-esplora-client", branch = "2022-10-get-merkle-block", default-features = false, optional = true }

lightning-transaction-sync/src/esplora.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ where
4141
#[cfg(not(feature = "async-interface"))]
4242
last_sync_hash: std::sync::Mutex<Option<BlockHash>>,
4343
#[cfg(feature = "async-interface")]
44-
last_sync_hash: tokio::sync::Mutex<Option<BlockHash>>,
44+
last_sync_hash: futures::lock::Mutex<Option<BlockHash>>,
4545
#[cfg(not(feature = "async-interface"))]
4646
client: BlockingClient,
4747
#[cfg(feature = "async-interface")]
@@ -139,7 +139,7 @@ where
139139
#[cfg(not(feature = "async-interface"))]
140140
let last_sync_hash = Mutex::new(None);
141141
#[cfg(feature = "async-interface")]
142-
let last_sync_hash = tokio::sync::Mutex::new(None);
142+
let last_sync_hash = futures::lock::Mutex::new(None);
143143
let builder = Builder::new(&server_url);
144144
#[cfg(not(feature = "async-interface"))]
145145
let client = builder.build_blocking().unwrap();

0 commit comments

Comments
 (0)