Skip to content

Commit

Permalink
f Use futures' Mutex rather than tokio's
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Dec 12, 2022
1 parent 5d94cb6 commit 2e7acb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lightning-transaction-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["esplora-blocking"]
esplora-async = ["async-interface", "esplora-client/async", "tokio"]
esplora-async = ["async-interface", "esplora-client/async", "futures"]
esplora-blocking = ["esplora-client/blocking"]
async-interface = []

[dependencies]
lightning = { version = "0.0.112", path = "../lightning" }
bitcoin = "0.29.0"
bdk-macros = "0.6"
tokio = { version = "1.0", default-features = false, features = [], optional = true }
futures = { version = "0.3", optional = true }
esplora-client = { git = "https://github.com/tnull/rust-esplora-client", branch = "2022-10-get-merkle-block", default-features = false, optional = true }
4 changes: 2 additions & 2 deletions lightning-transaction-sync/src/esplora.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ where
#[cfg(not(feature = "async-interface"))]
last_sync_hash: std::sync::Mutex<Option<BlockHash>>,
#[cfg(feature = "async-interface")]
last_sync_hash: tokio::sync::Mutex<Option<BlockHash>>,
last_sync_hash: futures::lock::Mutex<Option<BlockHash>>,
#[cfg(not(feature = "async-interface"))]
client: BlockingClient,
#[cfg(feature = "async-interface")]
Expand Down Expand Up @@ -139,7 +139,7 @@ where
#[cfg(not(feature = "async-interface"))]
let last_sync_hash = Mutex::new(None);
#[cfg(feature = "async-interface")]
let last_sync_hash = tokio::sync::Mutex::new(None);
let last_sync_hash = futures::lock::Mutex::new(None);
let builder = Builder::new(&server_url);
#[cfg(not(feature = "async-interface"))]
let client = builder.build_blocking().unwrap();
Expand Down

0 comments on commit 2e7acb2

Please sign in to comment.