Fix bugs about banning
MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjRoundConfig.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjRoundConfig.cs
@@ -108,6 +108,14 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
string jsonString = await File.ReadAllTextAsync(FilePath, Encoding.UTF8);
var config = JsonConvert.DeserializeObject<CcjRoundConfig>(jsonString);
+ UpdateOrDefault(config);
+ }
+
+ await ToFileAsync();
+ }
+
+ public void UpdateOrDefault(CcjRoundConfig config)
+ {
Denomination = config.Denomination ?? Denomination;
ConfirmationTarget = config.ConfirmationTarget ?? ConfirmationTarget;
CoordinatorFeePercent = config.CoordinatorFeePercent ?? CoordinatorFeePercent;
@@ -120,9 +128,6 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
DosDurationHours = config.DosDurationHours ?? DosDurationHours;
}
- await ToFileAsync();
- }
-
/// <inheritdoc />
public async Task<bool> CheckFileChangeAsync()
{

MODIFY
WalletWasabi/Services/CcjCoordinator.cs
WalletWasabi/Services/CcjCoordinator.cs
@@ -173,7 +173,7 @@ namespace WalletWasabi.Services
public void UpdateRoundConfig(CcjRoundConfig roundConfig)
{
- RoundConfig = Guard.NotNull(nameof(roundConfig), roundConfig);
+ RoundConfig.UpdateOrDefault(roundConfig);
}
public async Task MakeSureTwoRunningRoundsAsync()

MODIFY
WalletWasabi/Services/UtxoReferee.cs
WalletWasabi/Services/UtxoReferee.cs
@@ -115,7 +115,7 @@ namespace WalletWasabi.Services
if (BannedUtxos.TryRemove(output, out _))
{
IEnumerable<string> lines = BannedUtxos.Select(x => $"{x.Value.timeOfBan.ToString(CultureInfo.InvariantCulture)}:{x.Value.severity}:{x.Key.N}:{x.Key.Hash}");
- await File.AppendAllLinesAsync(BannedUtxosFilePath, lines);
+ await File.WriteAllLinesAsync(BannedUtxosFilePath, lines);
Logger.LogInfo<UtxoReferee>($"UTXO unbanned: {output.N}:{output.Hash}.");
}
}

Fix bugs about banning