Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cmd): check if the ln path that we know are good #220

Merged
merged 1 commit into from
Dec 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions coffee_core/src/coffee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ impl CoffeeManager {
return Ok(());
}
let root = self.config.cln_root.clone().unwrap();
// We check if there is some problem we the path that we know
if !fs::try_exists(root.clone()).await? {
return Err(error!("lightning root path `{}` do not exist", root));
} else if !fs::try_exists(format!("{root}/{}", self.config.network)).await? {
return Err(error!(
"lightning network path `{root}/{}` do not exist",
self.config.network
));
}
// All safe, we can move with the logic
let rpc = Client::new(format!("{root}/{}/lightning-rpc", self.config.network));
self.rpc = Some(rpc);
let path = self.config.cln_config_path.clone().unwrap();
Expand Down
Loading