Author

Topic: Is "Unknown wallet records" >0 normal? (Read 417 times)

member
Activity: 301
Merit: 74
March 13, 2019, 02:45:18 PM
#11
I know the wallet.dat version is unrelated, I just thought I'd ask since it was brought up earlier.
I'd best start a new thread.

staff
Activity: 3458
Merit: 6793
Just writing some code
March 12, 2019, 11:14:17 PM
#10
The warning you are seeing has nothing to do with whether or not your wallet has been upgraded. That warning is simply the result of new error logging code. In fact, the record that is unknown is one that has been in Bitcoin Core for an extremely long time. It may even be present in the very first version of the Bitcoin client.

Is doing a manual -upgradewallet normally necessary,
Yes. The wallet will not be upgraded automatically for you.

and if so, is encryption a hindrance?
No.

nFileVersion has changed by itself between 0.15 and 0.17, so by the looks of it it's automatic in this case.
nFileVersion is completely unrelated to wallet upgrades. It is in fact completely unused and only kept around for backwards compatibility reasons. It only indicates the highest version client that has opened a wallet file (because that was important in the past).
member
Activity: 301
Merit: 74
March 12, 2019, 08:11:20 PM
#9
Thanks for explaining.

Is doing a manual -upgradewallet normally necessary, and if so, is encryption a hindrance?
nFileVersion has changed by itself between 0.15 and 0.17, so by the looks of it it's automatic in this case.

staff
Activity: 3458
Merit: 6793
Just writing some code
March 11, 2019, 11:33:16 PM
#8
This is a known bug and has been fixed: https://github.com/bitcoin/bitcoin/pull/13967. The error is nothing to be worried about and can be safely ignored. All that happened is that we forgot a to handle a record type in the main wallet database reading loop (the record is read before this loop) in the change that adds logging of unknown records in that loop.
member
Activity: 301
Merit: 74
March 11, 2019, 08:59:20 PM
#7
I'm not trying to achieve anything other than understand the root cause.

The wallet was created in v0.15. I never ran with -upgradewallet (not explicitly anyway), though since the second start with v0.17 the wallet files have nFileVersion = 170001. Each wallet file shows an equal number (for that wallet) of "encrypted", "w/ metadata", and "total" records, and 0 plaintext.
Do I need to manually -upgradewallet to fully enable v0.16/0.17/segwit features?

If that's the reason for a single unknown record, how would one go about upgrading an encrypted wallet?
Issue #14422 doesn't suggest a solution.

Yes, I know the log message format was changed in the newer version, I can read the nearby code fine. But that doesn't clarify the core reason because I've no idea whether or not the presence of other strTypes is normal or expected. If it's simply the result of using an encrypted wallet file created before v0.16, that's a misleading log message that should, perhaps, be improved.
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
March 11, 2019, 01:48:00 AM
#6
The primary question is "Are you trying to upgrade the wallet and that is when this error comes in the debug.log?"
If not, what are you trying to achieve?
The unknown wallet records has occured in v0.17 due to the fact that there has been significant changes in the code between 0.15 and 0.17

The v0.15 code didn't consist of the unknown wallet record line and they were like

Code:
nKeys = nCKeys = nWatchKeys = nKeyMeta = 0;
...
LogPrintf("Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total\n",
           wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys);

While in the v0.17, unknown wallet records has been added replacing the older lines and they were like

Code:
nKeys = nCKeys = nWatchKeys = nKeyMeta = m_unknown_records = 0;
...
} else if (strType != "bestblock" && strType != "bestblock_nomerkle"){
            wss.m_unknown_records++;
...
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.m_unknown_records);

Going by the code, the unknown records are initially assigned to 0, but if the string type is not equal to the bestblock and bestblock_nomerkle value, unknown records seems to increase to 1 value and as such they are printed in the Unknown Wallet Records in the below line. (I am not completely sure of this, if this seems to be wrong someone try to correct me)

You should post the debug.log file here, so that we can get a clear insight on what is happening.
Probably if the wallet is encrypted, upgradewallet command will not work.
member
Activity: 301
Merit: 74
March 05, 2019, 09:51:50 PM
#5
Yeah, it's encrypted, with 0 plaintext keys.
How does this lead to the unknown one?
legendary
Activity: 2744
Merit: 3096
Top Crypto Casino
March 05, 2019, 07:50:36 PM
#4
Maybe because the wallet is encrypted.

I think this code is the one generating the message you got:

Code:
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.m_unknown_records);

debug log number of unknown wallet records on load #12888
member
Activity: 301
Merit: 74
March 05, 2019, 07:03:39 PM
#3
2 wallet files.

It's logged on every startup of Core.

legendary
Activity: 2730
Merit: 7065
March 05, 2019, 10:42:13 AM
#2
I am not sure what you are trying to do when you get this error. That error seems to appear when you try to load too many wallets in bitcoin core due to limitations in memory. If you have too many wallets you might have ran out of memory to store them. 

Have a look at this and see if this is what you are doing as well.
https://bitcoin.stackexchange.com/questions/82954/bitcoin-core-0-17-fails-after-loading-too-many-wallets
member
Activity: 301
Merit: 74
March 04, 2019, 08:27:19 PM
#1
Since upgrading from v0.15 to v0.17 the log shows:
Unknown wallet records: 1

Can this be considered normal? What might the unknown record be?
Jump to: