diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-06-20 12:31:02 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-06-20 17:33:06 +0100 |
commit | 6a0f61d80087259d7fa2e62df0e6cf68764dc3a4 (patch) | |
tree | 5c91d4962664db039a964ff7238e56ab70f5de7d /src/cryptonote_core/account.cpp | |
parent | wallet2: fix write_watch_only_wallet comment description (diff) | |
download | monero-6a0f61d80087259d7fa2e62df0e6cf68764dc3a4.tar.xz |
account: allow creating an account from a public address and view secret key
Diffstat (limited to 'src/cryptonote_core/account.cpp')
-rw-r--r-- | src/cryptonote_core/account.cpp | 16 |
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(×tamp); + } + //----------------------------------------------------------------- const account_keys& account_base::get_keys() const { return m_keys; |