Documentation required re mapInFlight #9054

issue rebroad opened this issue on November 1, 2016
  1. rebroad commented at 6:48 AM on November 1, 2016: contributor

    I've raised a few queries over the last few months regarding the use of mapInFlight but so far these haven't been answered and I am unaware of documentation that clarifies these queries. The code as it is seems vague and counter-intuitive regarding the current variable and function names, so I think clarification would to help to avoid potential future bugs. Plus, I notice there are currently three open issues relating to InFlight.

    When should MarkBlockAsReceived() be run? As soon as the block/cmpctblock/blocktxns is received?

    When should MarkBlockAsInFlight() be run? Just before or after pushing the getdata message?

    What does "in flight" mean exactly? My understanding was that it is blocks that have been requested and are yet to be received, however, lines in main.cpp say, for example "Blocks that are in flight, and that are in the queue to be downloaded", which seems to be a contradiction, as if they are in a queue this would imply they have not yet been requested.

    I am not familiar enough with the various coding methodologies out there, but I would have thought the current naming and usage of these functions would not comply with at least one of them... perhaps not, but even so, I continue to be confused by these functions (I hope I am not too unique in this regard).

    I hope this issue can also serve to set in motion (if it is not already) some form of process for ensuring functions like these are documented in some way. I am assuming that the current code is not intentionally obfuscated, but please correct me if this is a false assumption.

  2. fanquake added the label Docs and Output on Nov 2, 2016
  3. laanwj commented at 8:17 PM on November 2, 2016: member

    Please don't open specific "documentation needed" issues. We all know documentation is lacking, there's no end to this. If you discover any of these things, feel free to write documentation.

  4. laanwj closed this on Nov 2, 2016

  5. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

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

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