Skip to content

Commit 5321a6a

Browse files
committed
wallet: Preserve unsupported key origin flags
As originally implemented in PR bitcoin#5916, no longer supported at all.
1 parent 831675c commit 5321a6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wallet/walletdb.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,15 @@ class CKeyMetadata
123123
{
124124
public:
125125
static const int VERSION_BASIC=1;
126+
static const int VERSION_WITH_FLAGS = 2; // not supported, but preserved
126127
static const int VERSION_WITH_HDDATA=10;
127128
static const int VERSION_WITH_KEY_ORIGIN = 12;
128129
static const int CURRENT_VERSION=VERSION_WITH_KEY_ORIGIN;
129130
int nVersion;
130131
int64_t nCreateTime; // 0 means unknown
131132
std::string hdKeypath; //optional HD/bip32 keypath. Still used to determine whether a key is a seed. Also kept for backwards compatibility
132133
CKeyID hd_seed_id; //id of the HD seed used to derive this key
134+
uint8_t unsupported_key_flags;
133135
KeyOriginInfo key_origin; // Key origin info with path and fingerprint
134136
bool has_key_origin = false; //!< Whether the key_origin is useful
135137

@@ -148,6 +150,8 @@ class CKeyMetadata
148150
READWRITE(obj.nVersion, obj.nCreateTime);
149151
if (obj.nVersion >= VERSION_WITH_HDDATA) {
150152
READWRITE(obj.hdKeypath, obj.hd_seed_id);
153+
} else if (obj.nVersion >= VERSION_WITH_FLAGS) {
154+
READWRITE(obj.unsupported_key_flags);
151155
}
152156
if (obj.nVersion >= VERSION_WITH_KEY_ORIGIN)
153157
{

0 commit comments

Comments
 (0)