diff --git a/src/wallet/monero_wallet_core.cpp b/src/wallet/monero_wallet_core.cpp index 24ca589..741d62b 100644 --- a/src/wallet/monero_wallet_core.cpp +++ b/src/wallet/monero_wallet_core.cpp @@ -860,7 +860,7 @@ namespace monero { return wallet; } - monero_wallet_core* monero_wallet_core::create_wallet_from_keys(const string& path, const string& password, const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& language) { + monero_wallet_core* monero_wallet_core::create_wallet_from_keys(const string& path, const string& password, const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& language, shared_ptr http_client) { MTRACE("create_wallet_from_keys(path, password, address, view_key, spend_key, network_type, daemon_connection, restore_height, language)"); monero_wallet_core* wallet = new monero_wallet_core(); @@ -907,7 +907,8 @@ namespace monero { } // initialize wallet - wallet->m_w2 = unique_ptr(new tools::wallet2(static_cast(network_type), 1, true)); + if (http_client == nullptr) wallet->m_w2 = unique_ptr(new tools::wallet2(static_cast(network_type), 1, true)); + else wallet->m_w2 = unique_ptr(new tools::wallet2(static_cast(network_type), 1, true, http_client)); if (has_spend_key && has_view_key) wallet->m_w2->generate(path, password, info.address, spend_key_sk, view_key_sk); else if (has_spend_key) wallet->m_w2->generate(path, password, spend_key_sk, true, false); else wallet->m_w2->generate(path, password, info.address, view_key_sk); diff --git a/src/wallet/monero_wallet_core.h b/src/wallet/monero_wallet_core.h index 5c627fb..7e11339 100644 --- a/src/wallet/monero_wallet_core.h +++ b/src/wallet/monero_wallet_core.h @@ -154,7 +154,7 @@ namespace monero { * @param language is the wallet and mnemonic's language (defaults to "English") * @return a pointer to the wallet instance */ - static monero_wallet_core* create_wallet_from_keys(const string& path, const string& password, const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const monero_rpc_connection& daemon_connection = monero_rpc_connection(), uint64_t restore_height = 0, const string& language = "English"); + static monero_wallet_core* create_wallet_from_keys(const string& path, const string& password, const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const monero_rpc_connection& daemon_connection = monero_rpc_connection(), uint64_t restore_height = 0, const string& language = "English", shared_ptr http_client = nullptr); /** * Get a list of available languages for the wallet's mnemonic phrase.