Add cj input vs output check
MODIFY
WalletWasabi/WabiSabi/Backend/Models/WabiSabiProtocolErrorCode.cs
WalletWasabi/WabiSabi/Backend/Models/WabiSabiProtocolErrorCode.cs
@@ -34,7 +34,7 @@ public enum WabiSabiProtocolErrorCode
CryptoException,
AliceAlreadySignalled,
AliceAlreadyConfirmedConnection,
- AlreadyRegisteredOutputScript
+ AlreadyRegisteredScript
}
public static class WabiSabiProtocolErrorCodeExtension

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.Partial.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.Partial.cs
@@ -260,7 +260,13 @@ public partial class Arena : IWabiSabiApiRequestHandler
if (CoinJoinScriptStore?.Contains(request.Script) is true)
{
- throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.AlreadyRegisteredOutputScript, $"Round ({request.RoundId}): Already registered output.");
+ throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.AlreadyRegisteredScript, $"Round ({request.RoundId}): Already registered script.");
+ }
+
+ var inputScripts = round.Alices.Select(a => a.Coin.ScriptPubKey).ToHashSet();
+ if (inputScripts.Contains(request.Script))
+ {
+ throw new WabiSabiProtocolException(WabiSabiProtocolErrorCode.AlreadyRegisteredScript, $"Round ({request.RoundId}): Already registered script.");
}
Bob bob = new(request.Script, credentialAmount);

Add cj input vs output check