mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(cli) Allow Pruning CLI Args to take precedence over TOML configuration (#10774)
Co-authored-by: garwah <garwah@garwah>
This commit is contained in:
@ -351,8 +351,16 @@ impl<R> LaunchContextWith<Attached<WithConfigs, R>> {
|
||||
}
|
||||
|
||||
/// Returns the configured [`PruneConfig`]
|
||||
/// Any configuration set in CLI will take precedence over those set in toml
|
||||
pub fn prune_config(&self) -> Option<PruneConfig> {
|
||||
self.toml_config().prune.clone().or_else(|| self.node_config().prune_config())
|
||||
let Some(mut node_prune_config) = self.node_config().prune_config() else {
|
||||
// No CLI config is set, use the toml config.
|
||||
return self.toml_config().prune.clone();
|
||||
};
|
||||
|
||||
// Otherwise, use the CLI configuration and merge with toml config.
|
||||
node_prune_config.merge(self.toml_config().prune.clone());
|
||||
Some(node_prune_config)
|
||||
}
|
||||
|
||||
/// Returns the configured [`PruneModes`], returning the default if no config was available.
|
||||
|
||||
Reference in New Issue
Block a user