Earlier validation
MODIFY
WalletWasabi/WabiSabi/Client/ArenaClient.cs
WalletWasabi/WabiSabi/Client/ArenaClient.cs
@@ -109,9 +109,15 @@ namespace WalletWasabi.WabiSabi.Client
var myInputs = coinsToSign.ToDictionary(c => c.Outpoint);
var signedCoinJoin = unsignedCoinJoin.Clone();
- List<InputWitnessPair> signatures = new();
+ var myInputsFromCoinJoin = signedCoinJoin.Inputs.AsIndexedInputs().Where(input => myInputs.ContainsKey(input.PrevOut)).ToArray();
+
+ if (myInputs.Count != myInputsFromCoinJoin.Length)
+ {
+ throw new InvalidOperationException($"Missing inputs. Number of inputs: {myInputs.Count} actual: {myInputsFromCoinJoin.Length}.");
+ }
- foreach (var txInput in signedCoinJoin.Inputs.AsIndexedInputs().Where(input => myInputs.ContainsKey(input.PrevOut)))
+ List<InputWitnessPair> signatures = new();
+ foreach (var txInput in myInputsFromCoinJoin)
{
var coin = myInputs[txInput.PrevOut];
@@ -125,11 +131,6 @@ namespace WalletWasabi.WabiSabi.Client
signatures.Add(new InputWitnessPair(txInput.Index, txInput.WitScript));
}
- if (myInputs.Count != signatures.Count)
- {
- throw new InvalidOperationException($"Missing signatures. Number of signatures: {signatures.Count} actual: {myInputs.Count}.");
- }
-
await RequestHandler.SignTransactionAsync(new TransactionSignaturesRequest(roundId, signatures)).ConfigureAwait(false);
}
}

Earlier validation