1
0
Fork 0
forked from lthn/blockchain

fixed missing total field in get_recent_transfers struct

This commit is contained in:
cryptozoidberg 2019-12-01 23:31:05 +01:00
parent e3f2e2a30b
commit 7f374eab2a
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
3 changed files with 4 additions and 3 deletions

View file

@ -716,7 +716,7 @@ std::string daemon_backend::get_recent_transfers(size_t wallet_id, uint64_t offs
return API_RETURN_CODE_CORE_BUSY;
}
w->get()->get_recent_transfers_history(tr_hist.history, offset, count);
w->get()->get_recent_transfers_history(tr_hist.history, offset, count, tr_hist.total_history_items);
//workaround for missed fee
for (auto & he : tr_hist.history)
{

View file

@ -2515,7 +2515,7 @@ uint64_t wallet2::get_recent_transfers_total_count()
return m_transfer_history.size();
}
//----------------------------------------------------------------------------------------------------
void wallet2::get_recent_transfers_history(std::vector<wallet_public::wallet_transfer_info>& trs, size_t offset, size_t count)
void wallet2::get_recent_transfers_history(std::vector<wallet_public::wallet_transfer_info>& trs, size_t offset, size_t count, uint64_t& total)
{
if (offset >= m_transfer_history.size())
return;
@ -2526,6 +2526,7 @@ void wallet2::get_recent_transfers_history(std::vector<wallet_public::wallet_tra
stop = m_transfer_history.rend();
trs.insert(trs.end(), start, stop);
total = m_transfer_history.size();
}
//----------------------------------------------------------------------------------------------------
bool wallet2::get_transfer_address(const std::string& adr_str, currency::account_public_address& addr, std::string& payment_id)

View file

@ -459,7 +459,7 @@ namespace tools
currency::account_base& get_account() { return m_account; }
const currency::account_base& get_account() const { return m_account; }
void get_recent_transfers_history(std::vector<wallet_public::wallet_transfer_info>& trs, size_t offset, size_t count);
void get_recent_transfers_history(std::vector<wallet_public::wallet_transfer_info>& trs, size_t offset, size_t count, uint64_t& total);
uint64_t get_recent_transfers_total_count();
void get_unconfirmed_transfers(std::vector<wallet_public::wallet_transfer_info>& trs);
void init(const std::string& daemon_address = "http://localhost:8080");