Skip to content

Commit

Permalink
remove reindex_chainstate file on start
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominion5254 committed Jun 19, 2024
1 parent 77bab4d commit 7b422f9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions manager/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,18 @@ fn inner_main(reindex: bool, reindex_chainstate: bool) -> Result<(), Box<dyn Err
}
if reindex {
btc_args.push("-reindex".to_owned());
match fs::remove_file("/root/.bitcoin/requires.reindex") {
Ok(()) => (),
Err(e) if e.kind() == std::io::ErrorKind::NotFound => (),
a => a?,
}
} else if reindex_chainstate {
btc_args.push("-reindex-chainstate".to_owned());
match fs::remove_file("/root/.bitcoin/requires.reindex_chainstate") {
Ok(()) => (),
Err(e) if e.kind() == std::io::ErrorKind::NotFound => (),
a => a?,
}
}

std::io::copy(
Expand All @@ -471,13 +481,6 @@ fn inner_main(reindex: bool, reindex_chainstate: bool) -> Result<(), Box<dyn Err
let mut child = std::process::Command::new("bitcoind")
.args(btc_args)
.spawn()?;
if reindex {
match fs::remove_file("/root/.bitcoin/requires.reindex") {
Ok(()) => (),
Err(e) if e.kind() == std::io::ErrorKind::NotFound => (),
a => a?,
}
}
let raw_child = child.id();
*CHILD_PID.lock().unwrap() = Some(raw_child);
let pruned = {
Expand Down

0 comments on commit 7b422f9

Please sign in to comment.