Harden against mistakes handling invalid blocks #9765

pull sdaftuar wants to merge 1 commits into bitcoin:master from sdaftuar:fix-checkblock-call changing 2 files +13 −7
  1. sdaftuar commented at 1:23 PM on February 15, 2017: member

    Fixes a bug in AcceptBlock() in invoking CheckBlock() with incorrect arguments (introduced in #8068), and restores a call to CheckBlock() from ProcessNewBlock() as belt-and-suspenders (effectively reverting #7225).

    Updates the (overspecified) tests to match the slight behavior change (different reject code).

  2. Harden against mistakes handling invalid blocks
    Fixes a bug in AcceptBlock() in invoking CheckBlock() with incorrect
    arguments, and restores a call to CheckBlock() from ProcessNewBlock()
    as belt-and-suspenders.
    
    Updates the (overspecified) tests to match behavior.
    ba803efb68
  3. morcos commented at 3:44 PM on February 15, 2017: member

    utACK ba803ef

  4. morcos commented at 3:45 PM on February 15, 2017: member

    Also this is a bug fix that should be tagged 0.14 in my opinion

  5. laanwj added this to the milestone 0.14.0 on Feb 15, 2017
  6. gmaxwell commented at 6:22 PM on February 15, 2017: contributor

    utACK (will test)

  7. fanquake added the label Validation on Feb 15, 2017
  8. theuni commented at 7:40 PM on February 15, 2017: member

    Grr, we really shouldn't have default arguments in consensus code.

    utACK ba803efb687c2cb408176c546a544a8466c652ea.

  9. laanwj commented at 7:28 AM on February 16, 2017: member

    utACK ba803ef

    Grr, we really shouldn't have default arguments in consensus code.

    Bitfields/Enumerations instead of bool, bool, bool, ... also tends to help make code like this more readable and thus reviewable. Multiple boolean parameters to a function make code hard to understand, always have to look at the signature to find out which one is what.

  10. laanwj merged this on Feb 16, 2017
  11. laanwj closed this on Feb 16, 2017

  12. laanwj referenced this in commit 1e92e041dd on Feb 16, 2017
  13. kyuupichan cross-referenced this on May 17, 2017 from issue [Port] Eliminate unnecessary call to CheckBlock by kyuupichan
  14. codablock referenced this in commit a0685f8950 on Feb 7, 2018
  15. codablock referenced this in commit 23a9fa671c on Feb 8, 2018
  16. codablock referenced this in commit 4ac4e96e8f on Feb 8, 2018
  17. codablock cross-referenced this on Feb 8, 2018 from issue Backports from compact block related Bitcoin PRs by codablock
  18. gladcow cross-referenced this on Mar 1, 2018 from issue Backport compact blocks functionality from bitcoin by gladcow
  19. MarcoFalke cross-referenced this on Nov 27, 2018 from issue consensus: Avoid data race in CBlock class by hebasto
  20. promag cross-referenced this on Nov 29, 2018 from issue consensus: Move CheckBlock() call to critical section by hebasto
  21. andvgal referenced this in commit 54ef6fa1e4 on Jan 6, 2019
  22. CryptoCentric referenced this in commit 6ccf0538b5 on Feb 28, 2019
  23. CryptoCentric referenced this in commit 8bb3617254 on Mar 2, 2019
  24. TheBlueMatt cross-referenced this on Oct 16, 2019 from issue Return the AcceptBlock CValidationState directly in ProcessNewBlock by TheBlueMatt
  25. adamjonas cross-referenced this on Dec 16, 2020 from issue Suboptimal Block Checks by ghost
  26. bitcoin 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-05-19 13:55 UTC

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