From b5f20012d3bcd031fd9862c2923859e2fb5bfb58 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 15 Oct 2016 13:56:09 +0100 Subject: [PATCH 1/2] simplewallet: fix wrong amount in show_transfers --- src/simplewallet/simplewallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index b27113473..8a06a74f9 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3831,8 +3831,8 @@ bool simple_wallet::show_transfers(const std::vector &args_) m_wallet->get_payments_out(payments, min_height, max_height); for (std::list>::const_iterator i = payments.begin(); i != payments.end(); ++i) { const tools::wallet2::confirmed_transfer_details &pd = i->second; - uint64_t fee = pd.m_amount_in - pd.m_amount_out; uint64_t change = pd.m_change == (uint64_t)-1 ? 0 : pd.m_change; // change may not be known + uint64_t fee = pd.m_amount_in - pd.m_amount_out - change; std::string dests; for (const auto &d: pd.m_dests) { if (!dests.empty()) From 2d7083ca5652b2c85d23e19988ea1bcc5aa4c7d2 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 15 Oct 2016 13:56:25 +0100 Subject: [PATCH 2/2] wallet_api: fix wrong amount in tx history --- src/wallet/api/transaction_history.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/api/transaction_history.cpp b/src/wallet/api/transaction_history.cpp index e4a003b02..2ba5f3620 100644 --- a/src/wallet/api/transaction_history.cpp +++ b/src/wallet/api/transaction_history.cpp @@ -156,8 +156,8 @@ void TransactionHistoryImpl::refresh() const crypto::hash &hash = i->first; const tools::wallet2::confirmed_transfer_details &pd = i->second; - uint64_t fee = pd.m_amount_in - pd.m_amount_out; uint64_t change = pd.m_change == (uint64_t)-1 ? 0 : pd.m_change; // change may not be known + uint64_t fee = pd.m_amount_in - pd.m_amount_out - change; std::string payment_id = string_tools::pod_to_hex(i->second.m_payment_id);