GetScriptPubKeyMan spamming the logs with irrelevant message #21716

issue ben-kaufman openend this issue on April 17, 2021
  1. ben-kaufman commented at 7:55 am on April 17, 2021: contributor

    In the current way in which GetScriptPubKeyMan is used, there are multiple places where it is expected to fail and return empty. When this happens, the function writes to the logs that the searched output type doesn’t exist. Since this function is called in multiple places as part of a loop to search the output types which do exist, this logs gets outputted a lot, while it’s really quite irrelevant and expected. In the current situation, it can sometimes practically spam the logs with this quite unclear and worrying message, while in fact it is completely expected and (at least mostly) irrelevant…

    I would suggest to either remove it or suppress it where it is used in a loop to search for the existing type. If this makes sense I’d be happy to submit a PR for this.

  2. practicalswift commented at 10:32 am on April 17, 2021: contributor

    Can you provide some example log output (with any sensitive information removed) to illustrate the problem?

    I feel your pain generally: the log is part of the UI, and log spam is simply bad UI :)

  3. ben-kaufman commented at 1:02 pm on April 17, 2021: contributor

    Here’s how it looks for example when loading a wallet:

     02021-04-17T07:21:28Z opencon thread start
     12021-04-17T07:21:30Z New outbound peer connected: version: 70016, blocks=679562, peer=1 (block-relay)
     22021-04-17T07:21:31Z New outbound peer connected: version: 70016, blocks=679562, peer=2 (full-relay)
     32021-04-17T07:21:39Z P2P peers available. Skipped DNS seeding.
     42021-04-17T07:21:39Z dnsseed thread exit
     52021-04-17T07:21:54Z New outbound peer connected: version: 70015, blocks=679562, peer=3 (full-relay)
     62021-04-17T07:21:57Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
     72021-04-17T07:21:57Z init message: Loading wallet...
     82021-04-17T07:21:57Z Using SQLite Version 3.35.4
     92021-04-17T07:21:57Z init message: Loading wallet...
    102021-04-17T07:21:57Z [] Wallet File Version = 169900
    112021-04-17T07:21:57Z [] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
    122021-04-17T07:21:57Z [] External scriptPubKey Manager for output type 0 does not exist
    132021-04-17T07:21:57Z [] External scriptPubKey Manager for output type 1 does not exist
    142021-04-17T07:21:57Z [] Internal scriptPubKey Manager for output type 0 does not exist
    152021-04-17T07:21:57Z [] Internal scriptPubKey Manager for output type 1 does not exist
    162021-04-17T07:21:57Z [] Wallet completed loading in              98ms
    172021-04-17T07:21:57Z [] External scriptPubKey Manager for output type 0 does not exist
    182021-04-17T07:21:57Z [] External scriptPubKey Manager for output type 1 does not exist
    192021-04-17T07:21:57Z [] Internal scriptPubKey Manager for output type 0 does not exist
    202021-04-17T07:21:57Z [] Internal scriptPubKey Manager for output type 1 does not exist
    212021-04-17T07:21:57Z [] Wallet File Version = 169900
    222021-04-17T07:21:58Z [] Keys: 0 plaintext, 0 encrypted, 1806 w/ metadata, 0 total. Unknown wallet records: 0
    232021-04-17T07:21:58Z [] Wallet completed loading in             481ms
    242021-04-17T07:21:58Z ] setKeyPool.size() = 418
    252021-04-17T07:21:58Z [] mapWallet.size() = 125
    262021-04-17T07:21:58Z [] m_address_book.size() = 303
    272021-04-17T07:21:58Z [] External scriptPubKey Manager for output type 0 does not exist
    282021-04-17T07:21:58Z [] External scriptPubKey Manager for output type 1 does not exist
    292021-04-17T07:21:58Z [] Internal scriptPubKey Manager for output type 0 does not exist
    302021-04-17T07:21:58Z [] Internal scriptPubKey Manager for output type 1 does not exist
    312021-04-17T07:21:58Z [] setKeyPool.size() = 2000
    322021-04-17T07:21:58Z [] mapWallet.size() = 0
    332021-04-17T07:21:58Z [] m_address_book.size() = 0
    342021-04-17T07:21:58Z [] External scriptPubKey Manager for output type 0 does not exist
    352021-04-17T07:21:58Z [] External scriptPubKey Manager for output type 1 does not exist
    362021-04-17T07:21:58Z [] Internal scriptPubKey Manager for output type 0 does not exist
    372021-04-17T07:21:58Z [] Internal scriptPubKey Manager for output type 1 does not exist
    382021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 0 does not exist
    392021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 1 does not exist
    402021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 0 does not exist
    412021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 1 does not exist
    422021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 0 does not exist
    432021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 1 does not exist
    442021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 0 does not exist
    452021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 1 does not exist
    462021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 0 does not exist
    472021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 1 does not exist
    482021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 0 does not exist
    492021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 1 does not exist
    502021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 0 does not exist
    512021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 1 does not exist
    522021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 0 does not exist
    532021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 1 does not exist
    542021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 0 does not exist
    552021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 1 does not exist
    562021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 0 does not exist
    572021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 1 does not exist
    582021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 0 does not exist
    592021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 1 does not exist
    602021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 0 does not exist
    612021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 1 does not exist
    622021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 0 does not exist
    632021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 1 does not exist
    642021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 0 does not exist
    652021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 1 does not exist
    662021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 0 does not exist
    672021-04-17T07:21:59Z [] External scriptPubKey Manager for output type 1 does not exist
    682021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 0 does not exist
    692021-04-17T07:21:59Z [] Internal scriptPubKey Manager for output type 1 does not exist
    702021-04-17T07:21:59Z Using SQLite Version 3.35.4
    
  4. klementtan commented at 5:26 pm on May 7, 2021: contributor
    Created a PR(#21880) to attempt to fix this
  5. S3RK commented at 6:07 pm on June 29, 2021: member
    I believe we can just drop the log message in GetScriptPubKeyMan, all case when a log/error message is needed seemed to be covered by client-code #22334
  6. fanquake commented at 2:10 am on July 1, 2021: member
    Closing this as fixed-by #19651.
  7. fanquake closed this on Jul 1, 2021

  8. S3RK commented at 10:23 am on July 1, 2021: member
    #19651 only fixed a part of it. #22334 should fully address this issue
  9. DrahtBot locked this on Aug 18, 2022

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: 2024-12-18 18:12 UTC

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