diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -708,22 +708,20 @@ } }; -/** Private key that includes an expiration date in case it never gets used. */ -class CWalletKey { -public: +/** + * Private key that was serialized by an old wallet (only used for + * deserialization) */ +struct OldKey { CPrivKey vchPrivKey; - int64_t nTimeCreated; - int64_t nTimeExpires; - std::string strComment; - // todo: add something to note what created it (user, getnewaddress, - // change) maybe should have a map property map - - explicit CWalletKey(int64_t nExpires = 0); - ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream &s, Operation ser_action) { + // no longer used by the wallet, thus dropped after deserialization: + int64_t nTimeCreated; + int64_t nTimeExpires; + std::string strComment; + int nVersion = s.GetVersion(); if (!(s.GetType() & SER_GETHASH)) { READWRITE(nVersion); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -5142,11 +5142,6 @@ m_pre_split = false; } -CWalletKey::CWalletKey(int64_t nExpires) { - nTimeCreated = (nExpires ? GetTime() : 0); - nTimeExpires = nExpires; -} - void CMerkleTx::SetMerkleBranch(const BlockHash &block_hash, int posInBlock) { // Update the tx's hashBlock hashBlock = block_hash; diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -294,7 +294,7 @@ wss.nKeys++; ssValue >> pkey; } else { - CWalletKey wkey; + OldKey wkey; ssValue >> wkey; pkey = wkey.vchPrivKey; }