Skip to content

Commit

Permalink
core: sanity check about the config file
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Dec 10, 2024
1 parent 183cd57 commit f3cee47
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ldk-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use hyper_util::rt::TokioIo;

use crate::util::config::load_config;
use ldk_node::config::Config;
use std::fs;
use std::path::Path;
use std::sync::Arc;

Expand All @@ -39,6 +40,11 @@ fn main() {
std::process::exit(0);
}

if fs::File::open(arg).is_err() {
eprintln!("Invalid configuration file path: {}", arg);
std::process::exit(-1);
}

let mut ldk_node_config = Config::default();
let config_file = load_config(Path::new(arg)).expect("Invalid configuration file.");

Expand Down

0 comments on commit f3cee47

Please sign in to comment.