Skip to content

Commit fa6f22b

Browse files
author
MarcoFalke
committed
wallet: Rename CWalletKey to OldKey
1 parent fa6dc7f commit fa6f22b

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

src/wallet/wallet.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4626,12 +4626,6 @@ CKeyPool::CKeyPool(const CPubKey& vchPubKeyIn, bool internalIn)
46264626
m_pre_split = false;
46274627
}
46284628

4629-
CWalletKey::CWalletKey(int64_t nExpires)
4630-
{
4631-
nTimeCreated = (nExpires ? GetTime() : 0);
4632-
nTimeExpires = nExpires;
4633-
}
4634-
46354629
void CMerkleTx::SetMerkleBranch(const uint256& block_hash, int posInBlock)
46364630
{
46374631
// Update the tx's hashBlock

src/wallet/wallet.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -676,23 +676,18 @@ class COutput
676676
}
677677
};
678678

679-
/** Private key that includes an expiration date in case it never gets used. */
680-
class CWalletKey
681-
{
682-
public:
679+
/** Private key that was serialized by an old wallet (only used for deserialization) */
680+
struct OldKey {
683681
CPrivKey vchPrivKey;
684-
int64_t nTimeCreated;
685-
int64_t nTimeExpires;
686-
std::string strComment;
687-
// todo: add something to note what created it (user, getnewaddress, change)
688-
// maybe should have a map<string, string> property map
689-
690-
explicit CWalletKey(int64_t nExpires=0);
691-
692682
ADD_SERIALIZE_METHODS;
693683

694684
template <typename Stream, typename Operation>
695685
inline void SerializationOp(Stream& s, Operation ser_action) {
686+
// no longer used by the wallet, thus dropped after deserialization:
687+
int64_t nTimeCreated;
688+
int64_t nTimeExpires;
689+
std::string strComment;
690+
696691
int nVersion = s.GetVersion();
697692
if (!(s.GetType() & SER_GETHASH))
698693
READWRITE(nVersion);

src/wallet/walletdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
271271
wss.nKeys++;
272272
ssValue >> pkey;
273273
} else {
274-
CWalletKey wkey;
274+
OldKey wkey;
275275
ssValue >> wkey;
276276
pkey = wkey.vchPrivKey;
277277
}

0 commit comments

Comments
 (0)