forked from lthn/blockchain
made wallets_manager::get_recent_transfers aware of unconfirmed txs
This commit is contained in:
parent
e1c9e79c06
commit
b31dde50ae
1 changed files with 12 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue