Skip to content

Commit 72ec5b7

Browse files
committed
debug log number of unknown wallet records on load
1 parent 1d54004 commit 72ec5b7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/wallet/walletdb.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,14 @@ class CWalletScanState {
227227
unsigned int nCKeys;
228228
unsigned int nWatchKeys;
229229
unsigned int nKeyMeta;
230+
unsigned int m_unknown_records;
230231
bool fIsEncrypted;
231232
bool fAnyUnordered;
232233
int nFileVersion;
233234
std::vector<uint256> vWalletUpgrade;
234235

235236
CWalletScanState() {
236-
nKeys = nCKeys = nWatchKeys = nKeyMeta = 0;
237+
nKeys = nCKeys = nWatchKeys = nKeyMeta = m_unknown_records = 0;
237238
fIsEncrypted = false;
238239
fAnyUnordered = false;
239240
nFileVersion = 0;
@@ -504,6 +505,8 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
504505
strErr = "Error reading wallet database: SetHDChain failed";
505506
return false;
506507
}
508+
} else if (strType != "bestblock" && strType != "bestblock_nomerkle"){
509+
wss.m_unknown_records++;
507510
}
508511
} catch (...)
509512
{
@@ -595,8 +598,8 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
595598

596599
LogPrintf("nFileVersion = %d\n", wss.nFileVersion);
597600

598-
LogPrintf("Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total\n",
599-
wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys);
601+
LogPrintf("Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total. Unknown wallet records: %u\n",
602+
wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys, wss.m_unknown_records);
600603

601604
// nTimeFirstKey is only reliable if all keys have metadata
602605
if ((wss.nKeys + wss.nCKeys + wss.nWatchKeys) != wss.nKeyMeta)

0 commit comments

Comments
 (0)