Fix conceptual error
MODIFY
WalletWasabi/Extensions/NBitcoinExtensions.cs
WalletWasabi/Extensions/NBitcoinExtensions.cs
@@ -464,8 +464,8 @@ namespace NBitcoin
false => throw new NotImplementedException($"Size estimation isn't implemented for provided script type.")
};
- public static Money EffectiveValue(this TxOut output, FeeRate feeRate) =>
- output.Value - feeRate.GetFee(output.ScriptPubKey.EstimateOutputVsize());
+ public static Money EffectiveCost(this TxOut output, FeeRate feeRate) =>
+ output.Value + feeRate.GetFee(output.ScriptPubKey.EstimateOutputVsize());
public static Money EffectiveValue(this Coin coin, FeeRate feeRate) =>
coin.Amount - feeRate.GetFee(coin.ScriptPubKey.EstimateInputVsize());

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
WalletWasabi/WabiSabi/Client/CoinJoinClient.cs
@@ -84,7 +84,7 @@ namespace WalletWasabi.WabiSabi.Client
var unsignedCoinJoin = signingState.CreateUnsignedTransaction();
// Sanity check.
- var effectiveOutputs = outputTxOuts.Select(o => (o.EffectiveValue(roundState.FeeRate), o.ScriptPubKey));
+ var effectiveOutputs = outputTxOuts.Select(o => (o.EffectiveCost(roundState.FeeRate), o.ScriptPubKey));
if (!SanityCheck(effectiveOutputs, unsignedCoinJoin))
{
throw new InvalidOperationException($"Round ({roundState.Id}): My output is missing.");

MODIFY
WalletWasabi/WabiSabi/Client/CredentialDependencies/DependencyGraph.cs
WalletWasabi/WabiSabi/Client/CredentialDependencies/DependencyGraph.cs
@@ -57,7 +57,7 @@ namespace WalletWasabi.WabiSabi.Client.CredentialDependencies
}
var outputSizes = outputs.Select(x => x.ScriptPubKey.EstimateOutputVsize());
- var effectiveCosts = Enumerable.Zip(outputs, outputSizes, (txout, size) => txout.EffectiveValue(feerate));
+ var effectiveCosts = Enumerable.Zip(outputs, outputSizes, (txout, size) => txout.EffectiveCost(feerate));
return ResolveCredentialDependencies(
Enumerable.Zip(effectiveValues.Select(a => (ulong)a.Satoshi), inputSizes.Select(i => (ulong)i), ImmutableArray.Create).Cast<IEnumerable<ulong>>(),

Fix conceptual error