This commit is contained in:
woodser
2020-01-06 07:38:43 -05:00
parent 3b8ca8058e
commit fbdec58a08
+15
View File
@@ -825,14 +825,22 @@ namespace monero {
monero_wallet_core* monero_wallet_core::create_wallet_random(const string& path, const string& password, const monero_network_type network_type, const monero_rpc_connection& daemon_connection, const string& language, epee::net_utils::http::abstract_http_client *http_client) {
MTRACE("create_wallet_random(path, password, network_type, daemon_connection, language)");
monero_wallet_core* wallet = new monero_wallet_core();
cout << "1" << endl;
if (http_client == nullptr) wallet->m_w2 = unique_ptr<tools::wallet2>(new tools::wallet2(static_cast<cryptonote::network_type>(network_type), 1, true));
else wallet->m_w2 = unique_ptr<tools::wallet2>(new tools::wallet2(static_cast<cryptonote::network_type>(network_type), 1, true, http_client));
cout << "2" << endl;
wallet->set_daemon_connection(daemon_connection);
cout << "3" << endl;
wallet->m_w2->set_seed_language(language);
cout << "4" << endl;
crypto::secret_key secret_key;
cout << "5" << endl;
wallet->m_w2->generate(path, password, secret_key, false, false);
cout << "6" << endl;
wallet->init_common();
cout << "7" << endl;
if (wallet->is_connected()) wallet->m_w2->set_refresh_from_block_height(wallet->get_daemon_height());
cout << "8" << endl;
return wallet;
}
@@ -852,13 +860,20 @@ namespace monero {
if (!seed_offset.empty()) recovery_key = cryptonote::decrypt_key(recovery_key, seed_offset);
// initialize wallet
cout << "1" << endl;
if (http_client == nullptr) wallet->m_w2 = unique_ptr<tools::wallet2>(new tools::wallet2(static_cast<cryptonote::network_type>(network_type), 1, true));
else wallet->m_w2 = unique_ptr<tools::wallet2>(new tools::wallet2(static_cast<cryptonote::network_type>(network_type), 1, true, http_client));
cout << "2" << endl;
wallet->set_daemon_connection(daemon_connection);
cout << "3" << endl;
wallet->m_w2->set_seed_language(language);
cout << "4" << endl;
wallet->m_w2->generate(path, password, recovery_key, true, false);
cout << "5" << endl;
wallet->m_w2->set_refresh_from_block_height(restore_height);
cout << "6" << endl;
wallet->init_common();
cout << "7" << endl;
return wallet;
}