Minor performance increase
MODIFY
WalletWasabi/Models/TxoRef.cs
WalletWasabi/Models/TxoRef.cs
@@ -51,7 +51,7 @@ namespace WalletWasabi.Models
public static bool operator ==(OutPoint x, TxoRef y) => y?.TransactionId == x?.Hash && y?.Index == x?.N;
- public static bool operator ==(TxoRef x, OutPoint y) => y?.Hash == x?.TransactionId && y?.N == x?.Index;
+ public static bool operator ==(TxoRef x, OutPoint y) => y?.Hash == x?.TransactionId && y?.N == x?.Index; // Hash first, index second is faster.
public static bool operator !=(OutPoint x, TxoRef y) => !(x == y);

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -433,7 +433,7 @@ namespace WalletWasabi.Services
{
foreach (TxIn txin in tx.Transaction.Inputs)
{
- if (spentOutput == txin.PrevOut)
+ if (spentOutput.TransactionId == txin.PrevOut.Hash && spentOutput.Index == txin.PrevOut.N) // Don't do (spentOutput == txin.PrevOut), it's faster this way, because it won't check for null.
{
doubleSpends.Add(coin);
spent = true;

Minor performance increase