diff options
Diffstat (limited to 'src/wallet/api/transaction_history.cpp')
-rw-r--r-- | src/wallet/api/transaction_history.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/wallet/api/transaction_history.cpp b/src/wallet/api/transaction_history.cpp index b6ba8c359..59eca3dd7 100644 --- a/src/wallet/api/transaction_history.cpp +++ b/src/wallet/api/transaction_history.cpp @@ -134,14 +134,10 @@ void TransactionHistoryImpl::refresh() ti->m_subaddrAccount = pd.m_subaddr_index.major; ti->m_label = m_wallet->m_wallet->get_subaddress_label(pd.m_subaddr_index); ti->m_timestamp = pd.m_timestamp; - ti->m_confirmations = wallet_height - pd.m_block_height; + ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0; ti->m_unlock_time = pd.m_unlock_time; m_history.push_back(ti); - /* output.insert(std::make_pair(pd.m_block_height, std::make_pair(true, (boost::format("%20.20s %s %s %s") - % print_money(pd.m_amount) - % string_tools::pod_to_hex(pd.m_tx_hash) - % payment_id % "-").str()))); */ } // confirmed output transactions @@ -181,7 +177,7 @@ void TransactionHistoryImpl::refresh() ti->m_subaddrAccount = pd.m_subaddr_account; ti->m_label = pd.m_subaddr_indices.size() == 1 ? m_wallet->m_wallet->get_subaddress_label({pd.m_subaddr_account, *pd.m_subaddr_indices.begin()}) : ""; ti->m_timestamp = pd.m_timestamp; - ti->m_confirmations = wallet_height - pd.m_block_height; + ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0; // single output transaction might contain multiple transfers for (const auto &d: pd.m_dests) { |