simplewallet: add a new --restore-from-keys option

It is similar in use to --restore-from-view-key, but also expects
a spend private key.

Requested by luigi1112, and useful to restore MyMonero wallets.
This commit is contained in:
moneromooo-monero
2016-02-22 22:10:55 +00:00
parent 3860feecb8
commit 4513b4cd2b
6 changed files with 157 additions and 6 deletions

View File

@@ -184,6 +184,16 @@ 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 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
*/
void generate(const std::string& wallet, const std::string& password,
const cryptonote::account_public_address &account_public_address,
const crypto::secret_key& spendkey, const crypto::secret_key& viewkey);
/*!
* \brief Creates a watch only wallet from a public address and a view secret key.
* \param wallet_ Name of wallet file