From a678b7754964c86cefa5939738c2663a2bbccb30 Mon Sep 17 00:00:00 2001
From: Kimi <58662979+kiminuo@users.noreply.github.com>
Date: Thu, 9 May 2024 12:38:22 +0200
Subject: [PATCH] [config] It should be possible to modify settings in UI when
`--LogLevel` is set (#13002)
* Add an exception for `LogLevel`
* Update WalletWasabi.Daemon/Config.cs
---
WalletWasabi.Daemon/Config.cs | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/WalletWasabi.Daemon/Config.cs b/WalletWasabi.Daemon/Config.cs
index ed8e998f226..822eca43748 100644
--- a/WalletWasabi.Daemon/Config.cs
+++ b/WalletWasabi.Daemon/Config.cs
@@ -130,12 +130,18 @@ [ nameof(CoordinatorIdentifier)] = (
};
// Check if any config value is overridden (either by an environment value, or by a CLI argument).
- foreach ((_, IValue optionValue) in Data.Values)
+ foreach (string optionName in Data.Keys)
{
- if (optionValue.Overridden)
+ // It is allowed to override the log level.
+ if (!string.Equals(optionName, nameof(LogLevel)))
{
- IsOverridden = true;
- break;
+ (_, IValue optionValue) = Data[optionName];
+
+ if (optionValue.Overridden)
+ {
+ IsOverridden = true;
+ break;
+ }
}
}
@@ -185,6 +191,12 @@ [ nameof(CoordinatorIdentifier)] = (
EnvironmentHelpers.GetDataDir(Path.Combine("WalletWasabi", "Client")),
Environment.GetCommandLineArgs()).EffectiveValue;
+ /// Whether a config option was overridden by a command line argument or an environment variable.
+ ///
+ /// Changing config options in the UI while a config option is overridden would bring uncertainty if user understands consequences or not,
+ /// thus it is normally not allowed. However, there are exceptions as what options are taken into account, there is currently
+ /// one exception: .
+ ///
public bool IsOverridden { get; }
public EndPoint GetBitcoinP2pEndPoint()