diff --git a/parity/params.rs b/parity/params.rs index df0730b59..a1b28406a 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -253,16 +253,17 @@ pub fn tracing_switch_to_bool(switch: Switch, user_defaults: &UserDefaults) -> R } pub fn fatdb_switch_to_bool(switch: Switch, user_defaults: &UserDefaults, algorithm: Algorithm) -> Result { - if algorithm != Algorithm::Archive { - return Err("Fat DB is not supported with the chosen pruning option. Please rerun with `--pruning=archive`".into()); - } - - match (user_defaults.is_first_launch, switch, user_defaults.fat_db) { + let result = match (user_defaults.is_first_launch, switch, user_defaults.fat_db) { (false, Switch::On, false) => Err("FatDB resync required".into()), (_, Switch::On, _) => Ok(true), (_, Switch::Off, _) => Ok(false), (_, Switch::Auto, def) => Ok(def), + }; + + if result.clone().unwrap_or(false) && algorithm != Algorithm::Archive { + return Err("Fat DB is not supported with the chosen pruning option. Please rerun with `--pruning=archive`".into()); } + result } #[cfg(test)]