aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/account.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-06-20 22:40:41 +0200
committerRiccardo Spagni <ric@spagni.net>2015-06-20 22:40:47 +0200
commit4790db9d04ce705a9c4fe179375ac617efab105c (patch)
treee2df136c6b54dbfba3097c8749a248b1da477547 /src/cryptonote_core/account.cpp
parentMerge pull request #323 (diff)
parentsimplewallet: allow creating a wallet from a public address and view secret key (diff)
downloadmonero-4790db9d04ce705a9c4fe179375ac617efab105c.tar.xz
Merge pull request #324
dc4dbc1 simplewallet: allow creating a wallet from a public address and view secret key (moneromooo-monero) 6a0f61d account: allow creating an account from a public address and view secret key (moneromooo-monero) e05a58a wallet2: fix write_watch_only_wallet comment description (moneromooo-monero) 4bf6f0d simplewallet: forbid seed commands for watch only wallets (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/account.cpp')
-rw-r--r--src/cryptonote_core/account.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cryptonote_core/account.cpp b/src/cryptonote_core/account.cpp
index 313d803a5..eb79f5949 100644
--- a/src/cryptonote_core/account.cpp
+++ b/src/cryptonote_core/account.cpp
@@ -93,6 +93,22 @@ DISABLE_VS_WARNINGS(4244 4345)
return first;
}
//-----------------------------------------------------------------
+ void account_base::create_from_viewkey(const cryptonote::account_public_address& address, const crypto::secret_key& viewkey)
+ {
+ m_keys.m_account_address = address;
+ m_keys.m_view_secret_key = viewkey;
+
+ struct tm timestamp;
+ timestamp.tm_year = 2014 - 1900; // year 2014
+ timestamp.tm_mon = 4 - 1; // month april
+ timestamp.tm_mday = 15; // 15th of april
+ timestamp.tm_hour = 0;
+ timestamp.tm_min = 0;
+ timestamp.tm_sec = 0;
+
+ m_creation_timestamp = mktime(&timestamp);
+ }
+ //-----------------------------------------------------------------
const account_keys& account_base::get_keys() const
{
return m_keys;