mirror of
https://github.com/monero-project/monero.git
synced 2025-07-22 22:10:45 -04:00
Merge pull request #688
c2a1fee
simplewallet: prompt for private keys when generating wallets (moneromooo-monero)4513b4c
simplewallet: add a new --restore-from-keys option (moneromooo-monero)
This commit is contained in:
commit
bf09285443
6 changed files with 173 additions and 21 deletions
|
@ -93,9 +93,10 @@ DISABLE_VS_WARNINGS(4244 4345)
|
|||
return first;
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
void account_base::create_from_viewkey(const cryptonote::account_public_address& address, const crypto::secret_key& viewkey)
|
||||
void account_base::create_from_keys(const cryptonote::account_public_address& address, const crypto::secret_key& spendkey, const crypto::secret_key& viewkey)
|
||||
{
|
||||
m_keys.m_account_address = address;
|
||||
m_keys.m_spend_secret_key = spendkey;
|
||||
m_keys.m_view_secret_key = viewkey;
|
||||
|
||||
struct tm timestamp;
|
||||
|
@ -109,6 +110,13 @@ DISABLE_VS_WARNINGS(4244 4345)
|
|||
m_creation_timestamp = mktime(×tamp);
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
void account_base::create_from_viewkey(const cryptonote::account_public_address& address, const crypto::secret_key& viewkey)
|
||||
{
|
||||
crypto::secret_key fake;
|
||||
memset(&fake, 0, sizeof(fake));
|
||||
create_from_keys(address, fake, viewkey);
|
||||
}
|
||||
//-----------------------------------------------------------------
|
||||
const account_keys& account_base::get_keys() const
|
||||
{
|
||||
return m_keys;
|
||||
|
|
|
@ -58,6 +58,7 @@ namespace cryptonote
|
|||
public:
|
||||
account_base();
|
||||
crypto::secret_key generate(const crypto::secret_key& recovery_key = crypto::secret_key(), bool recover = false, bool two_random = false);
|
||||
void create_from_keys(const cryptonote::account_public_address& address, const crypto::secret_key& spendkey, const crypto::secret_key& viewkey);
|
||||
void create_from_viewkey(const cryptonote::account_public_address& address, const crypto::secret_key& viewkey);
|
||||
const account_keys& get_keys() const;
|
||||
std::string get_public_address_str(bool testnet) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue