api/wallet: properly disable key encryption

This commit is contained in:
stoffu
2018-08-25 14:22:26 +09:00
parent bb30a72367
commit ba8dd3479d
7 changed files with 15 additions and 16 deletions
+5 -6
View File
@@ -261,8 +261,8 @@ std::unique_ptr<tools::wallet2> make_basic(const boost::program_options::variabl
catch (const std::exception &e) { }
}
std::unique_ptr<tools::wallet2> wallet(new tools::wallet2(nettype, kdf_rounds));
wallet->init(unattended, std::move(daemon_address), std::move(login), 0, false, *trusted_daemon);
std::unique_ptr<tools::wallet2> wallet(new tools::wallet2(nettype, kdf_rounds, unattended));
wallet->init(std::move(daemon_address), std::move(login), 0, false, *trusted_daemon);
boost::filesystem::path ringdb_path = command_line::get_arg(vm, opts.shared_ringdb_dir);
wallet->set_ring_database(ringdb_path.string());
return wallet;
@@ -748,7 +748,7 @@ wallet_keys_unlocker::~wallet_keys_unlocker()
w.encrypt_keys(key);
}
wallet2::wallet2(network_type nettype, uint64_t kdf_rounds):
wallet2::wallet2(network_type nettype, uint64_t kdf_rounds, bool unattended):
m_multisig_rescan_info(NULL),
m_multisig_rescan_k(NULL),
m_run(true),
@@ -796,7 +796,7 @@ wallet2::wallet2(network_type nettype, uint64_t kdf_rounds):
m_ringdb(),
m_last_block_reward(0),
m_encrypt_keys_after_refresh(boost::none),
m_unattended(false)
m_unattended(unattended)
{
}
@@ -872,9 +872,8 @@ std::unique_ptr<wallet2> wallet2::make_dummy(const boost::program_options::varia
}
//----------------------------------------------------------------------------------------------------
bool wallet2::init(bool unattended, std::string daemon_address, boost::optional<epee::net_utils::http::login> daemon_login, uint64_t upper_transaction_weight_limit, bool ssl, bool trusted_daemon)
bool wallet2::init(std::string daemon_address, boost::optional<epee::net_utils::http::login> daemon_login, uint64_t upper_transaction_weight_limit, bool ssl, bool trusted_daemon)
{
m_unattended = unattended;
m_checkpoints.init_default_checkpoints(m_nettype);
if(m_http_client.is_connected())
m_http_client.disconnect();