debug log number of unknown wallet records on load #12888

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:unknownrec changing 1 files +6 −3
  1. instagibbs commented at 12:48 AM on April 5, 2018: member

    This would have saved me some time during wallet debugging, with minimal logging clutter.

  2. fanquake added the label Wallet on Apr 5, 2018
  3. fanquake added the label Utils/log/libs on Apr 5, 2018
  4. Empact commented at 12:51 AM on April 5, 2018: member

    How about logging the unknown record strTypes themselves, rather than the number? Would provide additional info and avoid the need for storing the state.

  5. instagibbs commented at 1:00 AM on April 5, 2018: member

    I've done a spammier approach on my own branches, but I suppose I could throw an std::set at the problem if people aren't against the idea.

  6. in src/wallet/walletdb.cpp:603 in cf0a63a697 outdated
     599 | @@ -597,6 +600,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
     600 |  
     601 |      LogPrintf("Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total\n",
     602 |             wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys);
     603 | +    LogPrintf("Unknown wallet records: %u\n", wss.m_unknown_records);
    


    practicalswift commented at 6:01 AM on April 5, 2018:

    To reduce the amount of logging I suggest printing this only if wss.m_unknown_records != 0.

    Alternatively add wss.m_unknown_records printing to the already existing log entry (Keys: …) above.


    laanwj commented at 8:03 AM on April 5, 2018:

    To reduce the amount of logging I suggest printing this only if wss.m_unknown_records != 0.

    Or print it on the same line as the Keys: (have one wallet statistics record). In that case it doesn't matter to log it every time.


    practicalswift commented at 8:14 AM on April 5, 2018:

    @laanwj Agreed! That was suggestion 2 :-)


    promag commented at 8:44 AM on April 5, 2018:

    instagibbs commented at 3:11 PM on April 5, 2018:

    I split it out because the print line is "Keys:", but I suppose this could have meant "Key/Value" versus "crypto keys"?


    instagibbs commented at 3:13 PM on April 5, 2018:

    It's counting only the crypto keys as "total", not metadata which I think led me to believe this.

    If I add it to the above line, I suppose I'll ommit it from "total"?


    laanwj commented at 11:45 AM on April 8, 2018:

    Indeed, I didn't mean to include it in keys but have it seperately e.g.

    Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total. Unknown wallet records: %u.
    
  7. laanwj commented at 8:03 AM on April 5, 2018: member

    ConceptACK

  8. promag commented at 8:46 AM on April 5, 2018: member

    Concept ACK. @instagibbs can you detail the purpose of this counter?

  9. laanwj commented at 8:54 AM on April 5, 2018: member

    If you want to log spammier stuff, put it in the "wallet" category. A total should suffice in the default case.

    On Thu, Apr 5, 2018, 03:00 Gregory Sanders notifications@github.com wrote:

    I've done a spammier approach on my own branches, but I suppose I could throw an std::set at the problem if people aren't against the idea.

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/12888#issuecomment-378790484, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHutvyxDHCK8bsujSlgy9c6AlBMJ8b4ks5tlWzAgaJpZM4THtIc .

  10. instagibbs commented at 3:14 PM on April 5, 2018: member

    @promag detail in the OP, or in the commit itself?

  11. practicalswift commented at 8:13 PM on April 5, 2018: contributor

    Agree with @laanwj after thinking about it: put this in the wallet category. Logging to the default log level should be reserved for things that are likely to be of interest for the end-user.

  12. promag commented at 10:43 PM on April 5, 2018: member

    @instagibbs I mean in what way is this counter useful? Just to understand why you are adding this.

  13. instagibbs commented at 10:45 PM on April 5, 2018: member

    @promag lets you know if there are "num" amount of records your wallet doesn't recognize. In my case it would have told me exactly what was going on(type typo).

  14. instagibbs force-pushed on Apr 9, 2018
  15. instagibbs force-pushed on Apr 9, 2018
  16. instagibbs commented at 2:57 PM on April 9, 2018: member

    put on single log entry as requested by @laanwj

  17. practicalswift commented at 5:11 PM on April 9, 2018: contributor

    utACK 6b25bae87c03d54d9624d4cce3f76f0033df7459

  18. instagibbs commented at 5:40 PM on April 10, 2018: member

    one test timed out, kicked it. Maybe it'll be faster after the unit test improvements...

  19. laanwj commented at 6:33 AM on April 11, 2018: member

    Noticed while testing: This should probably ignore bestblock and bestblock_nomerkle as it does write those.

  20. debug log number of unknown wallet records on load 72ec5b7766
  21. instagibbs force-pushed on Apr 11, 2018
  22. instagibbs commented at 3:48 PM on April 11, 2018: member

    updated to filter bestblock and bestblock_nomerkle entries.

  23. laanwj commented at 7:16 AM on April 12, 2018: member

    tested ack 72ec5b77668fcbd838dbd19723728af2c9a97208

  24. laanwj merged this on Apr 12, 2018
  25. laanwj closed this on Apr 12, 2018

  26. laanwj referenced this in commit 39439e5ab4 on Apr 12, 2018
  27. laanwj commented at 2:01 PM on April 13, 2018: member

    Looks like we forgot to account for minversion here.

  28. jasonbcox referenced this in commit ea8cef58c8 on Sep 27, 2019
  29. PastaPastaPasta referenced this in commit fa99b086ec on Jun 10, 2020
  30. PastaPastaPasta referenced this in commit fb983406cf on Jun 10, 2020
  31. PastaPastaPasta referenced this in commit 3f24c879b2 on Jun 10, 2020
  32. jonspock referenced this in commit ec8b6a7244 on Sep 30, 2020
  33. jonspock referenced this in commit 7d15dae2b8 on Oct 5, 2020
  34. jonspock referenced this in commit f2cdbfedba on Oct 10, 2020
  35. PastaPastaPasta referenced this in commit a4195d9638 on Nov 9, 2020
  36. PastaPastaPasta referenced this in commit d1f709b16c on Nov 12, 2020
  37. PastaPastaPasta referenced this in commit 5d40de49f2 on Dec 11, 2020
  38. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me