Sort coinjoin outputs by amount.
MODIFY
WalletWasabi/Extensions/NBitcoinExtensions.cs
WalletWasabi/Extensions/NBitcoinExtensions.cs
@@ -258,5 +258,10 @@ namespace NBitcoin
var extractedTx = psbt.ExtractTransaction();
return new SmartTransaction(extractedTx, height, blockHash, blockIndex, label, firstSeenIfMemPoolTime, isReplacement);
}
+
+ public static void SortByAmount(this TxOutList list)
+ {
+ list.Sort((x, y) => x.Value.CompareTo(y.Value));
+ }
}
}

MODIFY
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
@@ -401,6 +401,7 @@ namespace WalletWasabi.Models.ChaumianCoinJoin
// 7. Shuffle. NBitcoin's shuffle doesn't work: https://github.com/MetacoSA/NBitcoin/issues/713
transaction.Inputs.Shuffle();
transaction.Outputs.Shuffle();
+ transaction.Outputs.SortByAmount(); // So the coinjoin looks better in block explorer.
// 8. Create the unsigned transaction.
var builder = Network.CreateTransactionBuilder();

Sort coinjoin outputs by amount.