1
0
Fork 0
forked from lthn/blockchain

added parameter on open wallet for inital tx count

This commit is contained in:
cryptozoidberg 2019-12-05 21:19:16 +01:00
parent fdec0e5b7b
commit a199d87163
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
4 changed files with 6 additions and 4 deletions

View file

@ -655,7 +655,7 @@ std::string daemon_backend::get_my_offers(const bc_services::core_offers_filter&
return API_RETURN_CODE_OK;
}
std::string daemon_backend::open_wallet(const std::wstring& path, const std::string& password, view::open_wallet_response& owr)
std::string daemon_backend::open_wallet(const std::wstring& path, const std::string& password, uint64_t txs_to_return, view::open_wallet_response& owr)
{
std::shared_ptr<tools::wallet2> w(new tools::wallet2());
owr.wallet_id = m_wallet_id_counter++;
@ -677,7 +677,7 @@ std::string daemon_backend::open_wallet(const std::wstring& path, const std::str
try
{
w->load(path, password);
w->get_recent_transfers_history(owr.recent_history.history, 0, 100, owr.recent_history.total_history_items);
w->get_recent_transfers_history(owr.recent_history.history, 0, txs_to_return, owr.recent_history.total_history_items);
//w->get_unconfirmed_transfers(owr.recent_history.unconfirmed);
w->get_unconfirmed_transfers(owr.recent_history.history);
//workaround for missed fee

View file

@ -84,7 +84,7 @@ public:
bool start();
bool stop();
bool send_stop_signal();
std::string open_wallet(const std::wstring& path, const std::string& password, view::open_wallet_response& owr);
std::string open_wallet(const std::wstring& path, const std::string& password, uint64_t txs_to_return, view::open_wallet_response& owr);
std::string generate_wallet(const std::wstring& path, const std::string& password, view::open_wallet_response& owr);
std::string restore_wallet(const std::wstring& path, const std::string& password, const std::string& restore_key, view::open_wallet_response& owr);
std::string run_wallet(uint64_t wallet_id);

View file

@ -1602,7 +1602,7 @@ QString MainWindow::open_wallet(const QString& param)
//return que_call2<view::open_wallet_request>("open_wallet", param, [this](const view::open_wallet_request& owd, view::api_response& ar){
PREPARE_ARG_FROM_JSON(view::open_wallet_request, owd);
PREPARE_RESPONSE(view::open_wallet_response, ar);
ar.error_code = m_backend.open_wallet(epee::string_encoding::utf8_to_wstring(owd.path), owd.pass, ar.response_data);
ar.error_code = m_backend.open_wallet(epee::string_encoding::utf8_to_wstring(owd.path), owd.pass, owd.txs_to_return, ar.response_data);
return MAKE_RESPONSE(ar);
CATCH_ENTRY_FAIL_API_RESPONCE();
}

View file

@ -373,10 +373,12 @@ public:
{
std::string pass;
std::string path;
uint64_t txs_to_return;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(pass)
KV_SERIALIZE(path)
KV_SERIALIZE(txs_to_return)
END_KV_SERIALIZE_MAP()
};