From 468384d82af29c0e1611f618987a8df5563148f4 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Sat, 26 Mar 2022 11:19:30 +0200 Subject: [PATCH] omit frozen utxos from soroban collaboration wallets --- .../sparrow/soroban/CounterpartyController.java | 5 ++++- .../sparrowwallet/sparrow/soroban/InitiatorController.java | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/soroban/CounterpartyController.java b/src/main/java/com/sparrowwallet/sparrow/soroban/CounterpartyController.java index e39c7fb8..825bd32b 100644 --- a/src/main/java/com/sparrowwallet/sparrow/soroban/CounterpartyController.java +++ b/src/main/java/com/sparrowwallet/sparrow/soroban/CounterpartyController.java @@ -9,6 +9,7 @@ import com.samourai.wallet.cahoots.CahootsType; import com.sparrowwallet.drongo.protocol.Transaction; import com.sparrowwallet.drongo.psbt.PSBTParseException; import com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex; +import com.sparrowwallet.drongo.wallet.Status; import com.sparrowwallet.drongo.wallet.Wallet; import com.sparrowwallet.drongo.wallet.WalletNode; import com.sparrowwallet.sparrow.AppServices; @@ -296,7 +297,9 @@ public class CounterpartyController extends SorobanController { Soroban soroban = AppServices.getSorobanServices().getSoroban(walletId); Map walletUtxos = wallet.getWalletUtxos(); for(Map.Entry entry : walletUtxos.entrySet()) { - counterpartyCahootsWallet.addUtxo(entry.getValue(), wallet.getWalletTransaction(entry.getKey().getHash()), (int)entry.getKey().getIndex()); + if(entry.getKey().getStatus() != Status.FROZEN) { + counterpartyCahootsWallet.addUtxo(entry.getValue(), wallet.getWalletTransaction(entry.getKey().getHash()), (int)entry.getKey().getIndex()); + } } try { diff --git a/src/main/java/com/sparrowwallet/sparrow/soroban/InitiatorController.java b/src/main/java/com/sparrowwallet/sparrow/soroban/InitiatorController.java index a230f599..0111abae 100644 --- a/src/main/java/com/sparrowwallet/sparrow/soroban/InitiatorController.java +++ b/src/main/java/com/sparrowwallet/sparrow/soroban/InitiatorController.java @@ -433,7 +433,9 @@ public class InitiatorController extends SorobanController { Payment payment = walletTransaction.getPayments().get(0); Map firstSetUtxos = walletTransaction.isCoinControlUsed() ? walletTransaction.getSelectedUtxoSets().get(0) : wallet.getWalletUtxos(); for(Map.Entry entry : firstSetUtxos.entrySet()) { - initiatorCahootsWallet.addUtxo(entry.getValue(), wallet.getWalletTransaction(entry.getKey().getHash()), (int)entry.getKey().getIndex()); + if(entry.getKey().getStatus() != Status.FROZEN) { + initiatorCahootsWallet.addUtxo(entry.getValue(), wallet.getWalletTransaction(entry.getKey().getHash()), (int)entry.getKey().getIndex()); + } } SorobanCahootsService sorobanCahootsService = soroban.getSorobanCahootsService(initiatorCahootsWallet);