java-topology/defects/wasabi-0002/patch/wasabi-0002.patch

21 lines
1.2 KiB
Diff

# UNDF: UNDF-2026-000000921
--- a/WalletWasabi/Blockchain/Transactions/TransactionFactory.cs
+++ b/WalletWasabi/Blockchain/Transactions/TransactionFactory.cs
@@ -84,14 +84,15 @@ public class TransactionFactory
allowedSmartCoinInputs = allowedSmartCoinInputs
- .Where(x => parameters.AllowedInputs.Any(y => y.Hash == x.TransactionId && y.N == x.Index))
+ .Where(x => allowedInputSet.Contains(x.Outpoint))
.ToList();
// Add those that have the same script, because common ownership is already exposed.
// But only if the user didn't click the "max" button. In this case he'd send more money than what he'd think.
if (payments.ChangeStrategy != ChangeStrategy.AllRemainingCustom)
{
var allScripts = allowedSmartCoinInputs.Select(x => x.ScriptPubKey).ToHashSet();
- foreach (var coin in availableCoinsView.Where(x => !allowedSmartCoinInputs.Any(y => x.TransactionId == y.TransactionId && x.Index == y.Index)))
+ var existingOutpoints = allowedSmartCoinInputs.Select(x => x.Outpoint).ToHashSet();
+ foreach (var coin in availableCoinsView.Where(x => !existingOutpoints.Contains(x.Outpoint)))
{
if (!(parameters.AllowUnconfirmed || coin.Confirmed))
{