wallet: remove redundant Assert call when block is disconnected #32153

pull rkrux wants to merge 1 commits into bitcoin:master from rkrux:wallet-block changing 1 files +1 −1
  1. rkrux commented at 10:54 am on March 27, 2025: contributor

    It was highlighted in a PR discussion previously that the recently moved Assert macro call inside the block disconnected loop had been redundant for quite a while because of the presence of the assert macro call at the start of the function. Therefore, it is removed now.

    refs #https://github.com/bitcoin/bitcoin/pull/31757#discussion_r1995416821

  2. wallet: remove redundant `Assert` call when block is disconnected
    It was highlighted in a PR discussion previously that the recently
    moved `Assert` macro call inside the block disconnected loop had
    been redundant for quite a while because of the presence of the
    `assert` macro call at the start of the function. Therefore, it
    is removed now.
    
    refs #https://github.com/bitcoin/bitcoin/pull/31757#discussion_r1995416821
    ae6b6ea296
  3. DrahtBot commented at 10:54 am on March 27, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32153.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK l0rinc, fjahr, hodlinator, Prabhat1308
    Concept ACK pablomartin4btc

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Wallet on Mar 27, 2025
  5. l0rinc commented at 11:36 am on March 27, 2025: contributor

    The initial assert(block.data) at the function start already establishes that block.data is non-null + the loop already dereferences it

    crACK ae6b6ea296a228f342c3c635dc9e14c101e9534d

  6. rkrux marked this as ready for review on Mar 27, 2025
  7. pablomartin4btc commented at 2:23 pm on March 27, 2025: member
    cr ACK
  8. fjahr commented at 2:52 pm on March 27, 2025: contributor
    utACK ae6b6ea296a228f342c3c635dc9e14c101e9534d
  9. DrahtBot requested review from pablomartin4btc on Mar 27, 2025
  10. in src/wallet/wallet.cpp:1 in ae6b6ea296


    hodlinator commented at 10:56 pm on March 27, 2025:
    If you re-touch, I think it would be more correct to remove the # in the commit message at the beginning of refs #https://github.com/bitcoin/bitcoin/pull/31757#discussion_r1995416821 since it is a link and not a PR/Issue number.
  11. hodlinator approved
  12. hodlinator commented at 11:06 pm on March 27, 2025: contributor

    Code Review ACK ae6b6ea296a228f342c3c635dc9e14c101e9534d

    If something were so cheeky as to modify the incoming const interfaces::BlockInfo& block::data while we are using it, the approach on master would be broken too.

  13. Prabhat1308 commented at 3:38 am on March 28, 2025: none

    Code Review ACK ae6b6ea

    The check to make sure block.data is non-null inside the loop is redundant. The check is already made at the start and the check inside the loop can be removed safely.

  14. ryanofsky assigned ryanofsky on Mar 28, 2025
  15. ryanofsky merged this on Mar 28, 2025
  16. ryanofsky closed this on Mar 28, 2025


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: 2025-03-31 09:12 UTC

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