From 649a1b7ae663888c1ff51ce7b0fa2ed22a719aa4 Mon Sep 17 00:00:00 2001 From: Leon Klingele Date: Sun, 25 Feb 2018 17:59:52 +0100 Subject: wallet2 / simplewallet: Must opt-in to create '.address.txt' files for new wallets Previously, a file containing the unencrypted Monero address was created by default in the wallet's directory. This file might pose as a privacy risk. The creation of this file is now opt-in and can be enabled by providing --create-address-file --- src/wallet/wallet2.h | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'src/wallet/wallet2.h') diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 57a61cb9d..9d4a7d75a 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -449,44 +449,48 @@ namespace tools /*! * \brief Generates a wallet or restores one. - * \param wallet_ Name of wallet file - * \param password Password of wallet file - * \param multisig_data The multisig restore info and keys + * \param wallet_ Name of wallet file + * \param password Password of wallet file + * \param multisig_data The multisig restore info and keys + * \param create_address_file Whether to create an address file */ void generate(const std::string& wallet_, const epee::wipeable_string& password, - const std::string& multisig_data); + const std::string& multisig_data, bool create_address_file = false); /*! * \brief Generates a wallet or restores one. - * \param wallet_ Name of wallet file - * \param password Password of wallet file - * \param recovery_param If it is a restore, the recovery key - * \param recover Whether it is a restore - * \param two_random Whether it is a non-deterministic wallet - * \return The secret key of the generated wallet + * \param wallet_ Name of wallet file + * \param password Password of wallet file + * \param recovery_param If it is a restore, the recovery key + * \param recover Whether it is a restore + * \param two_random Whether it is a non-deterministic wallet + * \param create_address_file Whether to create an address file + * \return The secret key of the generated wallet */ crypto::secret_key generate(const std::string& wallet, const epee::wipeable_string& password, const crypto::secret_key& recovery_param = crypto::secret_key(), bool recover = false, - bool two_random = false); + bool two_random = false, bool create_address_file = false); /*! * \brief Creates a wallet from a public address and a spend/view secret key pair. - * \param wallet_ Name of wallet file - * \param password Password of wallet file - * \param viewkey view secret key - * \param spendkey spend secret key + * \param wallet_ Name of wallet file + * \param password Password of wallet file + * \param viewkey view secret key + * \param spendkey spend secret key + * \param create_address_file Whether to create an address file */ void generate(const std::string& wallet, const epee::wipeable_string& password, const cryptonote::account_public_address &account_public_address, - const crypto::secret_key& spendkey, const crypto::secret_key& viewkey); + const crypto::secret_key& spendkey, const crypto::secret_key& viewkey, bool create_address_file = false); /*! * \brief Creates a watch only wallet from a public address and a view secret key. - * \param wallet_ Name of wallet file - * \param password Password of wallet file - * \param viewkey view secret key + * \param wallet_ Name of wallet file + * \param password Password of wallet file + * \param viewkey view secret key + * \param create_address_file Whether to create an address file */ void generate(const std::string& wallet, const epee::wipeable_string& password, const cryptonote::account_public_address &account_public_address, - const crypto::secret_key& viewkey = crypto::secret_key()); + const crypto::secret_key& viewkey = crypto::secret_key(), bool create_address_file = false); /*! * \brief Restore a wallet hold by an HW. * \param wallet_ Name of wallet file -- cgit v1.2.3