Skip to content

Commit

Permalink
Add CKeyMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranz5 committed May 21, 2014
1 parent 09cea91 commit aebbe42
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/walletdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,37 @@ enum DBErrors
DB_NEED_REWRITE
};

class CKeyMetadata
{
public:
static const int CURRENT_VERSION=1;
int nVersion;
int64 nCreateTime; // 0 means unknown

CKeyMetadata()
{
SetNull();
}
CKeyMetadata(int64 nCreateTime_)
{
nVersion = CKeyMetadata::CURRENT_VERSION;
nCreateTime = nCreateTime_;
}

IMPLEMENT_SERIALIZE
(
READWRITE(this->nVersion);
nVersion = this->nVersion;
READWRITE(nCreateTime);
)

void SetNull()
{
nVersion = CKeyMetadata::CURRENT_VERSION;
nCreateTime = 0;
}
};

/** Access to the wallet database (wallet.dat) */
class CWalletDB : public CDB
{
Expand Down

0 comments on commit aebbe42

Please sign in to comment.