danicoin/src/CryptoNoteCore/Account.h

40 lines
1.1 KiB
C
Raw Normal View History

// Copyright (c) 2011-2016 The Cryptonote developers
2014-03-03 22:07:58 +00:00
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
2015-07-30 15:22:07 +00:00
#include "CryptoNoteCore/CryptoNoteBasic.h"
2014-03-03 22:07:58 +00:00
#include "crypto/crypto.h"
2015-05-27 12:08:46 +00:00
namespace CryptoNote {
2014-03-03 22:07:58 +00:00
2015-07-15 12:23:00 +00:00
class ISerializer;
2014-03-03 22:07:58 +00:00
/************************************************************************/
/* */
/************************************************************************/
2015-07-30 15:22:07 +00:00
class AccountBase {
2014-03-03 22:07:58 +00:00
public:
2015-07-30 15:22:07 +00:00
AccountBase();
2014-03-03 22:07:58 +00:00
void generate();
2015-07-30 15:22:07 +00:00
const AccountKeys& getAccountKeys() const;
void setAccountKeys(const AccountKeys& keys);
2014-03-03 22:07:58 +00:00
uint64_t get_createtime() const { return m_creation_timestamp; }
void set_createtime(uint64_t val) { m_creation_timestamp = val; }
2015-07-30 15:22:07 +00:00
void serialize(ISerializer& s);
2014-03-03 22:07:58 +00:00
template <class t_archive>
2014-08-13 10:51:37 +00:00
inline void serialize(t_archive &a, const unsigned int /*ver*/) {
2014-03-03 22:07:58 +00:00
a & m_keys;
a & m_creation_timestamp;
}
private:
2015-07-30 15:22:07 +00:00
void setNull();
AccountKeys m_keys;
2014-03-03 22:07:58 +00:00
uint64_t m_creation_timestamp;
};
}