Prevent locked UTXOs from being selected for spending by the UTXO selector

This commit is contained in:
pokkst 2022-09-23 02:35:02 -05:00
parent 9b4cd9860a
commit 452cc12c8f
No known key found for this signature in database
GPG key ID: 90C2ED85E67A50FF

View file

@ -41,7 +41,7 @@ public class UTXOService extends ServiceBase {
Collections.sort(utxos); Collections.sort(utxos);
//loop through each utxo //loop through each utxo
for (CoinsInfo coinsInfo : utxos) { for (CoinsInfo coinsInfo : utxos) {
if(!coinsInfo.isSpent()) { //filter out spent outputs if(!coinsInfo.isSpent() && coinsInfo.isUnlocked()) { //filter out spent and locked outputs
if (sendAll) { if (sendAll) {
// if send all, add all utxos and set amount to send all // if send all, add all utxos and set amount to send all
selectedUtxos.add(coinsInfo.getKeyImage()); selectedUtxos.add(coinsInfo.getKeyImage());