aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/transaction_history.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-10-15 18:25:08 +0200
committerRiccardo Spagni <ric@spagni.net>2017-10-15 18:25:08 +0200
commit960886aa04f0b50265884c0d4338031a93b1bc5d (patch)
treeb74d770e86309091072c4ca66a6dbef7fff5597a /src/wallet/api/transaction_history.cpp
parentMerge pull request #2555 (diff)
parentwallet2+API: use separate callbacks for lightwallets (diff)
downloadmonero-960886aa04f0b50265884c0d4338031a93b1bc5d.tar.xz
Merge pull request #2109
97c2e449 wallet2+API: use separate callbacks for lightwallets (Jaquee) d9261867 walletAPI: correct confirmations in txHistory for unsynced wallets (Jaquee) 9442b043 walletAPI: lightwallet exceptions (Jaquee) fc922934 walletAPI: add lightwallet login() and importWalletRequest() (Jaquee) 79207743 walletAPI: init() lightwallet and SSL support (Jaquee) dde5a1fc walletAPI: add tx unlock_time (Jaquee) bba5cbed wallet2: remove obsolete get_num_rct_outputs() call from create_transactions_2 (Jaquee) 7a482f30 wallet2: create_transactions_2 lightwallet support (Jaquee) ce61b818 wallet2: get_outs lightwallet support (Jaquee) 1197cb71 wallet2: commit_tx() lightwallet support (Jaquee) 43b57804 wallet2: refactor is_tx_spendtime_unlocked() (Jaquee) 32e2b003 wallet2: add lightwallet exceptions to common functions (Jaquee) 2e692fc0 wallet2: refresh() lightwallet support (Jaquee) f44d156c my/openmonero API functions (Jaquee) 288d3c75 wallet2: add remove_obsolete_pool_txs() (Jaquee) 2c6aad7e wallet2: add on_pool_tx_removed callback (Jaquee) ff7c30aa wallet2: light wallet member variables (Jaquee) e2a276cb wallet2: add ssl option to init() (Jaquee) a13540be add string_tools::validate_hex() (Jaquee) fd773d88 refactor cryptonote_basic::add_tx_pub_key_to_extra (Jaquee) 8bfa6c2d lightwallet rpc server commands (Jaquee) 76961ddc Serializer: string to integer conversion for MyMonero compatibility (Jaquee) 1cf940f2 epee http_client SSL support (Jaquee) eec10137 CMakeLists.txt - Add openssl include dir (Jaquee)
Diffstat (limited to 'src/wallet/api/transaction_history.cpp')
-rw-r--r--src/wallet/api/transaction_history.cpp8
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) {