[code review] Isn't this check redundant? #19223

issue MithrilMan opened this issue on June 9, 2020
  1. MithrilMan commented at 1:30 PM on June 9, 2020: none

    https://github.com/bitcoin/bitcoin/blob/9ad6f14175c19b5d47267c3dd5840c14bad43c83/src/validation.cpp#L3711

    If i'm following right the flow of the code, when we hit this lane pindex should be always equal to nullptr thus this check may be omitted

  2. naumenkogs commented at 12:04 PM on June 10, 2020: member

    I verified the code, I think you are correct: it always equals nullptr.

  3. promag commented at 9:17 PM on August 2, 2020: member

    ACK, the branch where pindex is set early returns.

  4. jnewbery commented at 4:57 PM on January 6, 2021: member

    ~I agree. The line below:~

    https://github.com/bitcoin/bitcoin/blob/9ad6f14175c19b5d47267c3dd5840c14bad43c83/src/validation.cpp#L3715

    ~could also be changed to directly change *ppindex to nullptr.~

    ~Seems like it's been this way since the function was added in #3884~

    EDIT: ignore. I misread the function. Thanks @jarolrod for correcting me!

  5. MarcoFalke closed this on Feb 1, 2021

  6. sidhujag referenced this in commit 8c9e35cddd on Feb 2, 2021
  7. 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: 2026-04-26 06:14 UTC

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