Skip to content

Commit 478fe32

Browse files
committed
Merge #16475: wallet: Enumerate walletdb keys
fa6f22b wallet: Rename CWalletKey to OldKey (MarcoFalke) fa6dc7f wallet: Enumerate walletdb keys (MarcoFalke) Pull request description: It is nice to see all the keys that exists in a single enum Also, rename CWalletKey to OldKey and update the outdated documentation ACKs for top commit: laanwj: ACK fa6f22b, I'm a big fan of this kind of change as it prevents typos, which can happen with 'magic' strings in the code. promag: ACK fa6f22b. @jnewbery suggestions are great followups, I think this is good enough. meshcollider: utACK fa6f22b achow101: Code review ACK fa6f22b fanquake: ACK fa6f22b - I had a quick look over, definitely prefer this to strings floating around everywhere. Tree-SHA512: 8ac3abd5a0d22dac1d77b8f97fe1e16c2608d650f3e9d6dd1df2fd5aeb35ef6643dfd4cd5c162404bb0100343c927d66df04dc695507ffc84a6c667e603acc54
2 parents 2410088 + fa6f22b commit 478fe32

File tree

4 files changed

+121
-113
lines changed

4 files changed

+121
-113
lines changed

src/wallet/wallet.cpp

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

4630-
CWalletKey::CWalletKey(int64_t nExpires)
4631-
{
4632-
nTimeCreated = (nExpires ? GetTime() : 0);
4633-
nTimeExpires = nExpires;
4634-
}
4635-
46364630
void CMerkleTx::SetMerkleBranch(const uint256& block_hash, int posInBlock)
46374631
{
46384632
// 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);

0 commit comments

Comments
 (0)