From 3721665ea62a6b076793a1079d0f254442987b1e Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 4 Oct 2021 18:33:58 +0200 Subject: [PATCH] TransactionInfo: fix balance delta for incoming txs --- src/libwalletqt/TransactionInfo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libwalletqt/TransactionInfo.cpp b/src/libwalletqt/TransactionInfo.cpp index f7ad540..2a6bce4 100644 --- a/src/libwalletqt/TransactionInfo.cpp +++ b/src/libwalletqt/TransactionInfo.cpp @@ -28,7 +28,13 @@ bool TransactionInfo::isCoinbase() const quint64 TransactionInfo::balanceDelta() const { - return m_amount + m_fee; + if (m_direction == Direction_In) { + return m_amount; + } + else if (m_direction == Direction_Out) { + return m_amount + m_fee; + } + return m_amount; } double TransactionInfo::amount() const