From a440c22455009c64c96fc417d108075c56a93e98 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 19 Apr 2021 09:50:09 +0200 Subject: [PATCH] deduct unconfirmed transactions with negative values from balance --- .../sparrow/wallet/WalletTransactionsEntry.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletTransactionsEntry.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletTransactionsEntry.java index 31019793..9318270e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletTransactionsEntry.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletTransactionsEntry.java @@ -37,9 +37,11 @@ public class WalletTransactionsEntry extends Entry { for(Entry entry : getChildren()) { TransactionEntry transactionEntry = (TransactionEntry)entry; - if(transactionEntry.getConfirmations() != 0) { + if(transactionEntry.getConfirmations() != 0 || transactionEntry.getValue() < 0) { balance += entry.getValue(); - } else { + } + + if(transactionEntry.getConfirmations() == 0) { mempoolBalance += entry.getValue(); }