Skip to content

Commit

Permalink
Run sample only in sync
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyhodl committed Nov 1, 2024
1 parent 65a040d commit e3b9caa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sample/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ edition = "2018"
name = "sample"
version = "0.1.0"

[features]
async = []

[dependencies]
bitcoin = {version = "0.32.2"}
bitcoin-rpc-provider = {path = "../bitcoin-rpc-provider"}
Expand Down
11 changes: 11 additions & 0 deletions sample/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ macro_rules! read_id_or_continue {
};
}

#[cfg(feature = "async")]
pub(crate) async fn poll_for_user_input(
_peer_manager: Arc<PeerManager>,
_dlc_message_handler: Arc<DlcMessageHandler>,
_dlc_manager: Arc<Mutex<DlcManager>>,
_offers_path: &str,
) {
println!("Sample does not run async manager.");
std::process::exit(0)
}
#[cfg(not(feature = "async"))]
pub(crate) async fn poll_for_user_input(
peer_manager: Arc<PeerManager>,
dlc_message_handler: Arc<DlcMessageHandler>,
Expand Down
1 change: 1 addition & 0 deletions sample/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(unused_macros, unused_imports, dead_code)]
mod cli;
mod disk;
mod hex_utils;
Expand Down

0 comments on commit e3b9caa

Please sign in to comment.