aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/account.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-02-29 17:30:29 -0500
committerRiccardo Spagni <ric@spagni.net>2016-02-29 17:30:29 -0500
commitbf09285443fef9c5d7752fd2731ae6e942c8a27f (patch)
tree37d41ecd6acb403c702a19d09d1873f0bf77eeef /src/cryptonote_core/account.cpp
parentMerge pull request #687 (diff)
parentsimplewallet: prompt for private keys when generating wallets (diff)
downloadmonero-bf09285443fef9c5d7752fd2731ae6e942c8a27f.tar.xz
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)
Diffstat (limited to 'src/cryptonote_core/account.cpp')
-rw-r--r--src/cryptonote_core/account.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cryptonote_core/account.cpp b/src/cryptonote_core/account.cpp
index 0d2175ed7..c3f2b4446 100644
--- a/src/cryptonote_core/account.cpp
+++ b/src/cryptonote_core/account.cpp
@@ -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(&timestamp);
}
//-----------------------------------------------------------------
+ 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;