1
0
Fork 0
forked from lthn/blockchain

made wallets_manager::get_recent_transfers aware of unconfirmed txs

This commit is contained in:
sowle 2020-04-06 16:28:12 +03:00
parent e1c9e79c06
commit b31dde50ae
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -796,16 +796,21 @@ std::string wallets_manager::get_recent_transfers(size_t wallet_id, uint64_t off
return API_RETURN_CODE_CORE_BUSY;
}
w->get()->get_unconfirmed_transfers(tr_hist.unconfirmed);
w->get()->get_recent_transfers_history(tr_hist.history, offset, count, tr_hist.total_history_items);
auto fix_tx = [](tools::wallet_public::wallet_transfer_info& wti) -> void {
wti.show_sender = currency::is_showing_sender_addres(wti.tx);
if (!wti.fee && !currency::is_coinbase(wti.tx))
wti.fee = currency::get_tx_fee(wti.tx);
};
//workaround for missed fee
for (auto & he : tr_hist.unconfirmed)
fix_tx(he);
for (auto & he : tr_hist.history)
{
he.show_sender = currency::is_showing_sender_addres(he.tx);
if (!he.fee && !currency::is_coinbase(he.tx))
{
he.fee = currency::get_tx_fee(he.tx);
}
}
fix_tx(he);
return API_RETURN_CODE_OK;
}