diff --git a/parser/src/main.rs b/parser/src/main.rs index 63492e135..87c4b06c2 100644 --- a/parser/src/main.rs +++ b/parser/src/main.rs @@ -1,6 +1,5 @@ use std::{path::Path, thread::sleep, time::Duration}; -use color_eyre::eyre::eyre; use parser::{iter_blocks, log, BitcoinDB, BitcoinDaemon, Config}; fn main() -> color_eyre::Result<()> { @@ -9,13 +8,18 @@ fn main() -> color_eyre::Result<()> { let config = Config::read(); if config.datadir.is_none() { - return Err(eyre!( - "You need to set the --datadir parameter at least once to run the parser" - )); + println!( + "You need to set the --datadir parameter at least once to run the parser.\nRun the program with '-h' for help." + ); + std::process::exit(1); } config.write()?; + if true { + panic!(); + } + let daemon = BitcoinDaemon::new(&config); loop { diff --git a/parser/src/structs/config.rs b/parser/src/structs/config.rs index 44e69ff15..4bc4639d2 100644 --- a/parser/src/structs/config.rs +++ b/parser/src/structs/config.rs @@ -27,7 +27,7 @@ impl Config { const PATH: &'static str = "config.toml"; pub fn read() -> Self { - File::open(Self::PATH).unwrap(); + fs::write(Self::PATH, "").unwrap(); let string = fs::read_to_string(Self::PATH).unwrap();