Skip to content

Commit ff57fb4

Browse files
committed
Merge #15709: wallet: Do not add "setting" key as unknown
914923d Add setting as known type (Peter Bushnell) Pull request description: When loading old wallets I get "Unknown wallet records" showing up in the log file. The key that is adding to the unknown record count is "setting", this is a known key removed in the 0.6 release of Bitcoin in the commit linked below. The "setting" key is not known to the wallet anymore, like "acentry" which is not added as an unknown record, but the "setting" key was used in previous versions of Bitcoin. bitcoin/bitcoin@972060c#diff-8094838580e1bb7a3bb8fc78dcebc733 ACKs for top commit: laanwj: ACK 914923d, this code change is straightforward enough and I don't think it makes sense to warn about this key being present. meshcollider: ACK 914923d Tree-SHA512: 6346690c05cebae2dcd868512322bf5250f6fbd07abb5e747065444185d3f69e19e1a99e3f38d6e34535ffd6979b2297100ba9c7da8e45ca792598eded5ae0d3
2 parents 3389461 + 914923d commit ff57fb4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/wallet/walletdb.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const std::string OLD_KEY{"wkey"};
4040
const std::string ORDERPOSNEXT{"orderposnext"};
4141
const std::string POOL{"pool"};
4242
const std::string PURPOSE{"purpose"};
43+
const std::string SETTINGS{"settings"};
4344
const std::string TX{"tx"};
4445
const std::string VERSION{"version"};
4546
const std::string WATCHMETA{"watchmeta"};
@@ -407,7 +408,8 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
407408
return false;
408409
}
409410
} else if (strType != DBKeys::BESTBLOCK && strType != DBKeys::BESTBLOCK_NOMERKLE &&
410-
strType != DBKeys::MINVERSION && strType != DBKeys::ACENTRY && strType != DBKeys::VERSION) {
411+
strType != DBKeys::MINVERSION && strType != DBKeys::ACENTRY &&
412+
strType != DBKeys::VERSION && strType != DBKeys::SETTINGS) {
411413
wss.m_unknown_records++;
412414
}
413415
} catch (const std::exception& e) {

src/wallet/walletdb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ extern const std::string OLD_KEY;
7474
extern const std::string ORDERPOSNEXT;
7575
extern const std::string POOL;
7676
extern const std::string PURPOSE;
77+
extern const std::string SETTINGS;
7778
extern const std::string TX;
7879
extern const std::string VERSION;
7980
extern const std::string WATCHMETA;

0 commit comments

Comments
 (0)