Process "notfound" messages, and safeguard against unreasonably long … #8403

pull rebroad wants to merge 1 commits into bitcoin:master from rebroad:ProcessNotfound changing 1 files +22 −0
  1. rebroad commented at 3:27 PM on July 25, 2016: contributor

    …ones.

    For years, I've been getting many many of these in my debug.log:-

    2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719 2016-07-25 15:10:45 Unknown command "notfound" from peer=62719

    This pull request will remove this message, which is technically incorrect anyway.

  2. Process "notfound" messages, and safeguard against unreasonably long ones. 4899de9fbe
  3. in src/main.cpp:None in 4899de9fbe
    6124 | +        {
    6125 | +            const CInv &inv = vInv[nInv];
    6126 | +
    6127 | +            boost::this_thread::interruption_point();
    6128 | +            if (inv.type == MSG_TX || inv.type == MSG_WITNESS_TX)
    6129 | +                 LogPrint("tx", "notfound: %s from peer=%d\n", inv.ToString(), pfrom->id);
    


    laanwj commented at 3:58 PM on July 25, 2016:

    Do you really want to log a line for every single record? This can be up to 50,000 in one message.

  4. laanwj commented at 3:59 PM on July 25, 2016: member

    Concept ACK, though I think the number of log lines per message should be limited.

  5. jonasschnelli added the label P2P on Jul 26, 2016
  6. gmaxwell commented at 7:37 AM on July 26, 2016: contributor

    Do we need to log any details here at all? We've done fine for years without doing so...

  7. sipa commented at 7:38 AM on July 26, 2016: member

    I think we can just 'process' notfound messages by ignoring them.

  8. laanwj commented at 8:44 AM on July 26, 2016: member

    Agree @sipa. "just don't regard them as unknown" would be the most obvious, and likely best, solution. Now you just move them to two other log classes, which get burdened with more messages.

    If you really, really want to log them (say, for debugging purposes) they should be in a separate log class, and the entire processing should be skipped if this log class is not enabled.

  9. laanwj commented at 3:44 PM on July 29, 2016: member

    Closing in favor of #8427.

  10. laanwj closed this on Jul 29, 2016

  11. 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 18:15 UTC

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