wallet: Rename CWalletKey to OldKey
This commit is contained in:
parent
fa6dc7fa5f
commit
fa6f22bf44
3 changed files with 8 additions and 19 deletions
|
@ -4626,12 +4626,6 @@ CKeyPool::CKeyPool(const CPubKey& vchPubKeyIn, bool internalIn)
|
||||||
m_pre_split = false;
|
m_pre_split = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CWalletKey::CWalletKey(int64_t nExpires)
|
|
||||||
{
|
|
||||||
nTimeCreated = (nExpires ? GetTime() : 0);
|
|
||||||
nTimeExpires = nExpires;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMerkleTx::SetMerkleBranch(const uint256& block_hash, int posInBlock)
|
void CMerkleTx::SetMerkleBranch(const uint256& block_hash, int posInBlock)
|
||||||
{
|
{
|
||||||
// Update the tx's hashBlock
|
// Update the tx's hashBlock
|
||||||
|
|
|
@ -676,23 +676,18 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Private key that includes an expiration date in case it never gets used. */
|
/** Private key that was serialized by an old wallet (only used for deserialization) */
|
||||||
class CWalletKey
|
struct OldKey {
|
||||||
{
|
|
||||||
public:
|
|
||||||
CPrivKey vchPrivKey;
|
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<string, string> property map
|
|
||||||
|
|
||||||
explicit CWalletKey(int64_t nExpires=0);
|
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
template <typename Stream, typename Operation>
|
template <typename Stream, typename Operation>
|
||||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
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();
|
int nVersion = s.GetVersion();
|
||||||
if (!(s.GetType() & SER_GETHASH))
|
if (!(s.GetType() & SER_GETHASH))
|
||||||
READWRITE(nVersion);
|
READWRITE(nVersion);
|
||||||
|
|
|
@ -271,7 +271,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
|
||||||
wss.nKeys++;
|
wss.nKeys++;
|
||||||
ssValue >> pkey;
|
ssValue >> pkey;
|
||||||
} else {
|
} else {
|
||||||
CWalletKey wkey;
|
OldKey wkey;
|
||||||
ssValue >> wkey;
|
ssValue >> wkey;
|
||||||
pkey = wkey.vchPrivKey;
|
pkey = wkey.vchPrivKey;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue