Fix too low coord fee
MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -191,8 +191,16 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
var coordinatorScriptPubKey = Config.GetNextCleanCoordinatorScript();
var coordinationFee = round.Alices.Sum(x => round.CoordinationFeeRate.GetFee(x.Coin.Amount));
coordinationFee -= round.FeeRate.GetFee(coordinatorScriptPubKey.EstimateOutputVsize());
+
+ if (coordinationFee > coinjoin.Parameters.AllowedOutputAmounts.Min)
+ {
coinjoin = round.AddOutput(new TxOut(coordinationFee, coordinatorScriptPubKey));
}
+ else
+ {
+ round.LogWarning($"Coordinator fee wasn't taken, because it was too small: {nameof(diffMoney)}: {diffMoney}, {nameof(allReady)}: {allReady}.");
+ }
+ }
round.CoinjoinState = coinjoin.Finalize();

MODIFY
WalletWasabi/WabiSabi/Backend/WabiSabiConfig.cs
WalletWasabi/WabiSabi/Backend/WabiSabiConfig.cs
@@ -96,10 +96,15 @@ namespace WalletWasabi.WabiSabi.Backend
[JsonConverter(typeof(ExtPubKeyJsonConverter))]
public ExtPubKey CoordinatorExtPubKey { get; } = Constants.WabiSabiFallBackCoordinatorExtPubKey;
- [DefaultValue(0)]
+ [DefaultValue(1)]
[JsonProperty(PropertyName = "CoordinatorExtPubKeyCurrentDepth", DefaultValueHandling = DefaultValueHandling.Populate)]
public int CoordinatorExtPubKeyCurrentDepth { get; private set; }
+ /// <summary>
+ /// If money comes to the blame script, then either an attacker lost money or there's a client bug.
+ /// </summary>
+ public Script BlameScript => DeriveCoordinatorScript(0);
+
public Script GetNextCleanCoordinatorScript() => DeriveCoordinatorScript(CoordinatorExtPubKeyCurrentDepth);
public Script DeriveCoordinatorScript(int index) => CoordinatorExtPubKey.Derive(0, false).Derive(index, false).PubKey.WitHash.ScriptPubKey;
@@ -109,10 +114,5 @@ namespace WalletWasabi.WabiSabi.Backend
CoordinatorExtPubKeyCurrentDepth++;
ToFile();
}
-
- /// <summary>
- /// If money comes to the blame script, then either an attacker lost money or there's a client bug.
- /// </summary>
- public Script BlameScript => DeriveCoordinatorScript(0);
}
}

Fix too low coord fee