From 3869fb89b60091281b43a35921057ba3f43c18f0 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 10 Jun 2013 09:36:29 -0400 Subject: Wallet: store key creation time. Calculate whole-wallet birthday. This also encapsulate wallet-read state information into CWalletScanState. --- src/wallet.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/wallet.h') diff --git a/src/wallet.h b/src/wallet.h index 674bae66dd..a0688b8a02 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -123,6 +123,8 @@ public: std::set setLockedCoins; + int64 nTimeFirstKey; + // check whether we are allowed to upgrade (or already support) to the named feature bool CanSupportFeature(enum WalletFeature wf) { return nWalletMaxVersion >= wf; } @@ -138,14 +140,14 @@ public: // Generate a new key CPubKey GenerateNewKey(); // Adds a key to the store, and saves it to disk. - bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey); + bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey, int64 nCreateTime = 0); // Adds a key to the store, without saving it to disk (used by LoadWallet) bool LoadKey(const CKey& key, const CPubKey &pubkey) { return CCryptoKeyStore::AddKeyPubKey(key, pubkey); } bool LoadMinVersion(int nVersion) { nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; } // Adds an encrypted key to the store, and saves it to disk. - bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector &vchCryptedSecret); + bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector &vchCryptedSecret, int64 nCreateTime = 0); // Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector &vchCryptedSecret); bool AddCScript(const CScript& redeemScript); -- cgit v1.2.3