Coordinator pays for overhead
MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -554,7 +554,7 @@ public partial class Arena : PeriodicRunner
{
// If timeout we must fill up the outputs to build a reasonable transaction.
// This won't be signed by the alice who failed to provide output, so we know who to ban.
- var estimatedBlameScriptCost = round.Parameters.MiningFeeRate.GetFee(blameScript.EstimateOutputVsize() + MultipartyTransactionParameters.SharedOverhead);
+ var estimatedBlameScriptCost = round.Parameters.MiningFeeRate.GetFee(blameScript.EstimateOutputVsize() + coinjoin.UnpaidSharedOverhead);
var diffMoney = coinjoin.Balance - coinjoin.EstimatedCost - estimatedBlameScriptCost;
if (diffMoney > round.Parameters.AllowedOutputAmounts.Min)
{
@@ -604,11 +604,11 @@ public partial class Arena : PeriodicRunner
}
else
{
- var effectiveCoordinationFee = coordinationFee - round.Parameters.MiningFeeRate.GetFee(coordinatorScriptPubKey.EstimateOutputVsize());
+ var effectiveCoordinationFee = coordinationFee - round.Parameters.MiningFeeRate.GetFee(coordinatorScriptPubKey.EstimateOutputVsize() + MultipartyTransactionParameters.SharedOverhead);
if (effectiveCoordinationFee > round.Parameters.AllowedOutputAmounts.Min)
{
- coinjoin = coinjoin.AddOutput(new TxOut(effectiveCoordinationFee, coordinatorScriptPubKey));
+ coinjoin = coinjoin.AddOutput(new TxOut(effectiveCoordinationFee, coordinatorScriptPubKey)).AsPayingForSharedOverhead();
}
else
{

MODIFY
WalletWasabi/WabiSabi/Models/MultipartyTransaction/MultipartyTransactionState.cs
WalletWasabi/WabiSabi/Models/MultipartyTransaction/MultipartyTransactionState.cs
@@ -46,7 +46,8 @@ public abstract record MultipartyTransactionState
[JsonIgnore]
public Money EstimatedCost => Parameters.MiningFeeRate.GetFee(EstimatedVsize - UnpaidSharedOverhead);
- [JsonIgnore] protected int UnpaidSharedOverhead { get; init; } = MultipartyTransactionParameters.SharedOverhead;
+ [JsonIgnore]
+ public int UnpaidSharedOverhead { get; init; } = MultipartyTransactionParameters.SharedOverhead;
[JsonIgnore]
public FeeRate EffectiveFeeRate => new(Balance, EstimatedVsize - UnpaidSharedOverhead);

Coordinator pays for overhead