diff --git a/src/Stratis.Bitcoin.Features.Wallet/WalletRPCController.cs b/src/Stratis.Bitcoin.Features.Wallet/WalletRPCController.cs index 1572567a54..708ef3a9d5 100644 --- a/src/Stratis.Bitcoin.Features.Wallet/WalletRPCController.cs +++ b/src/Stratis.Bitcoin.Features.Wallet/WalletRPCController.cs @@ -772,7 +772,7 @@ public UnspentCoinModel[] ListUnspent(int minConfirmations = 1, int maxConfirmat continue; WalletAccountReference accountReference = new WalletAccountReference(walletName, account.Name); - + IEnumerable spendableTransactions = this.walletManager.GetSpendableTransactionsInAccount(accountReference, minConfirmations); foreach (var spendableTx in spendableTransactions) @@ -783,6 +783,11 @@ public UnspentCoinModel[] ListUnspent(int minConfirmations = 1, int maxConfirmat if (addresses.Any() && !addresses.Contains(BitcoinAddress.Create(spendableTx.Address.Address, this.FullNode.Network))) continue; + // Check if the transaction is already in the list. + // The node operator could be using the wallet for both "actual" and watch only accounts. + if (unspentCoins.Any(u => u.Id == spendableTx.Transaction.Id && u.Index == spendableTx.Transaction.Index)) + continue; + unspentCoins.Add(new UnspentCoinModel() { Account = accountReference.AccountName,