aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/transaction_history.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-02 23:11:30 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-02 23:11:30 +0000
commitb5d6faada3d5604214de436a9acbb1687ca35587 (patch)
treef69531fa7ad225884267ac3e903203708036f31b /src/wallet/api/transaction_history.cpp
parentMerge pull request #1272 (diff)
downloadmonero-b5d6faada3d5604214de436a9acbb1687ca35587.tar.xz
wallet: fix bad amounts/fees again
m_amount_out was sometimes getting initialized with the sum of an transaction's outputs, and sometimes with the sum of outputs that were not change. This caused confusion and bugs. We now always set it to the sum of outputs. This reverts an earlier fix for bad amounts as this used the other semantics. The wallet data should be converted automatically in a percentage of cases that I'm hesitant to estimate. In any case, restoring from seed or keys or rebuilding the cache will get it right.
Diffstat (limited to 'src/wallet/api/transaction_history.cpp')
-rw-r--r--src/wallet/api/transaction_history.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/api/transaction_history.cpp b/src/wallet/api/transaction_history.cpp
index 2ba5f3620..63c4ea3cc 100644
--- a/src/wallet/api/transaction_history.cpp
+++ b/src/wallet/api/transaction_history.cpp
@@ -157,7 +157,7 @@ void TransactionHistoryImpl::refresh()
const tools::wallet2::confirmed_transfer_details &pd = i->second;
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;
+ uint64_t fee = pd.m_amount_in - pd.m_amount_out;
std::string payment_id = string_tools::pod_to_hex(i->second.m_payment_id);