debug log number of unknown wallet records on load

This commit is contained in:
Gregory Sanders 2018-04-04 17:46:40 -07:00
parent 1d540046fe
commit 72ec5b7766

View File

@ -227,13 +227,14 @@ public:
unsigned int nCKeys; unsigned int nCKeys;
unsigned int nWatchKeys; unsigned int nWatchKeys;
unsigned int nKeyMeta; unsigned int nKeyMeta;
unsigned int m_unknown_records;
bool fIsEncrypted; bool fIsEncrypted;
bool fAnyUnordered; bool fAnyUnordered;
int nFileVersion; int nFileVersion;
std::vector<uint256> vWalletUpgrade; std::vector<uint256> vWalletUpgrade;
CWalletScanState() { CWalletScanState() {
nKeys = nCKeys = nWatchKeys = nKeyMeta = 0; nKeys = nCKeys = nWatchKeys = nKeyMeta = m_unknown_records = 0;
fIsEncrypted = false; fIsEncrypted = false;
fAnyUnordered = false; fAnyUnordered = false;
nFileVersion = 0; nFileVersion = 0;
@ -504,6 +505,8 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
strErr = "Error reading wallet database: SetHDChain failed"; strErr = "Error reading wallet database: SetHDChain failed";
return false; return false;
} }
} else if (strType != "bestblock" && strType != "bestblock_nomerkle"){
wss.m_unknown_records++;
} }
} catch (...) } catch (...)
{ {
@ -595,8 +598,8 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
LogPrintf("nFileVersion = %d\n", wss.nFileVersion); LogPrintf("nFileVersion = %d\n", wss.nFileVersion);
LogPrintf("Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total\n", LogPrintf("Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total. Unknown wallet records: %u\n",
wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys); wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys, wss.m_unknown_records);
// nTimeFirstKey is only reliable if all keys have metadata // nTimeFirstKey is only reliable if all keys have metadata
if ((wss.nKeys + wss.nCKeys + wss.nWatchKeys) != wss.nKeyMeta) if ((wss.nKeys + wss.nCKeys + wss.nWatchKeys) != wss.nKeyMeta)