simplewallet: allow creating a wallet from a public address and view secret key

The needed information is supplied via a triple:

--generate-from-view-key address:viewkey:filename
This commit is contained in:
moneromooo-monero
2015-06-20 12:31:53 +01:00
parent 6a0f61d800
commit dc4dbc1ceb
4 changed files with 124 additions and 8 deletions

View File

@@ -145,6 +145,15 @@ namespace tools
crypto::secret_key generate(const std::string& wallet, const std::string& password,
const crypto::secret_key& recovery_param = crypto::secret_key(), bool recover = false,
bool two_random = 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
*/
void generate(const std::string& wallet, const std::string& password,
const cryptonote::account_public_address &account_public_address,
const crypto::secret_key& viewkey = crypto::secret_key());
/*!
* \brief Rewrites to the wallet file for wallet upgrade (doesn't generate key, assumes it's already there)
* \param wallet_name Name of wallet file (should exist)