Skip to content

Commit

Permalink
Also check blame round max fees (WalletWasabi#13191)
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbolay authored Jul 3, 2024
1 parent bf98ee0 commit e65bae3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions WalletWasabi/WabiSabi/Client/CoinJoin/Client/CoinJoinClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ private async Task<RoundState> WaitForBlameRoundAsync(uint256 blameRoundId, Canc
throw new InvalidOperationException($"Blame Round ({roundState.Id}): Abandoning: the round is not economic.");
}

if (roundState.CoinjoinState.Parameters.CoordinationFeeRate.Rate * 100 > CoinJoinConfiguration.MaxCoordinationFeeRate)
{
throw new InvalidOperationException($"Blame Round ({roundState.Id}): Abandoning: " +
$"the coordinator is malicious and tried to trick the client into paying a coordination fee rate of {roundState.CoinjoinState.Parameters.CoordinationFeeRate.Rate * 100}% for the blame round");
}

if (roundState.CoinjoinState.Parameters.MiningFeeRate.SatoshiPerByte > CoinJoinConfiguration.MaxCoinJoinMiningFeeRate)
{
throw new InvalidOperationException($"Blame Round ({roundState.Id}): Abandoning: " +
$"the mining fee rate for the round was {roundState.CoinjoinState.Parameters.MiningFeeRate.SatoshiPerByte} sats/vb but maximum allowed is {CoinJoinConfiguration.MaxCoinJoinMiningFeeRate}.");
}

return roundState;
}

Expand Down

0 comments on commit e65bae3

Please sign in to comment.