Skip to content

Commit fac29a0

Browse files
author
MarcoFalke
committed
Remove SER_GETHASH, hard-code client version in CKeyPool serialize
It was never set, so it can be removed along with any code reading it.
1 parent fa72f09 commit fac29a0

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/serialize.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ enum
131131
// primary actions
132132
SER_NETWORK = (1 << 0),
133133
SER_DISK = (1 << 1),
134-
SER_GETHASH = (1 << 2),
135134
};
136135

137136
/**

src/wallet/scriptpubkeyman.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,14 @@ class CKeyPool
123123
template<typename Stream>
124124
void Serialize(Stream& s) const
125125
{
126-
int nVersion = s.GetVersion();
127-
if (!(s.GetType() & SER_GETHASH)) {
128-
s << nVersion;
129-
}
126+
s << int{259900}; // Unused field, writes the highest client version ever written
130127
s << nTime << vchPubKey << fInternal << m_pre_split;
131128
}
132129

133130
template<typename Stream>
134131
void Unserialize(Stream& s)
135132
{
136-
int nVersion = s.GetVersion();
137-
if (!(s.GetType() & SER_GETHASH)) {
138-
s >> nVersion;
139-
}
133+
s >> int{}; // Discard unused field
140134
s >> nTime >> vchPubKey;
141135
try {
142136
s >> fInternal;

0 commit comments

Comments
 (0)