mirror of
https://github.com/monero-project/monero.git
synced 2025-12-23 07:29:11 -08:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user