Skip to content
Permalink
Browse files

Add CWalletScanState

  • Loading branch information
iamunick committed Jun 6, 2014
1 parent d47193f commit ca9673a4c65e03a4da98452080df9e947a6add76
Showing with 48 additions and 0 deletions.
  1. +17 −0 src/walletdb.cpp
  2. +31 −0 src/walletdb.h
@@ -181,6 +181,23 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
return DB_LOAD_OK;
}

class CWalletScanState {
public:
unsigned int nKeys;
unsigned int nCKeys;
unsigned int nKeyMeta;
bool fIsEncrypted;
bool fAnyUnordered;
int nFileVersion;
vector<uint256> vWalletUpgrade;

CWalletScanState() {
nKeys = nCKeys = nKeyMeta = 0;
fIsEncrypted = false;
fAnyUnordered = false;
nFileVersion = 0;
}
};

bool
ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
@@ -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
{

0 comments on commit ca9673a

Please sign in to comment.
You can’t perform that action at this time.