Bugfix CValidationResult for BIP30 + add DoS #2279

pull sipa wants to merge 1 commits into bitcoin:master from sipa:cvrbip30 changing 1 files +1 −1
  1. sipa commented at 3:35 PM on February 6, 2013: member

    Hopefully a better solution for #2254 than #2277.

  2. Bugfix CValidationResult for BIP30 + add DoS 7cdc37c0a4
  3. gavinandresen commented at 4:38 PM on February 6, 2013: contributor

    For belt-and-suspenders sanity, I think places where we rely on other methods to set state.Invalid should have asserts; e.g.:

    // Check it again in case a previous version let a bad block in                                                     
    if (!CheckBlock(state, !fJustCheck, !fJustCheck))
    {
        assert(!state.IsValid()); // Rely on CheckBlock to set invalid state
        return false;
    }
    
  4. gavinandresen commented at 6:43 PM on February 6, 2013: contributor

    After more code review: ACK for 0.8

    But I think some deeper thought would be good for a better approach to handling database corruption/loss.

    For example: if CBlock::DisconnectBlock() returns error("DisconnectBlock() : no undo data available"); ... then SetBestChain() will return false-but-with-a-valid-state ... so ConnectBestBlock() will return etc... ... so AddToBlockIndex() ... ... so AcceptBlock() ... ... so ProcessBlock() will return false-but-with-a-valid-state ... which looks like the right thing to do in all the cases where ProcessBlock() is called.

  5. luke-jr commented at 6:54 PM on February 6, 2013: member

    I suppose an advantage of the return-CValidationResult model would be that we'd get the compiler yelling at us for any missing states...

  6. BitcoinPullTester commented at 8:40 PM on February 6, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/7cdc37c0a427a378944cf58798164320110efe39 for binaries and test log.

  7. gavinandresen referenced this in commit 8f66aedfaa on Feb 6, 2013
  8. gavinandresen merged this on Feb 6, 2013
  9. gavinandresen closed this on Feb 6, 2013

  10. sipa deleted the branch on May 3, 2013
  11. laudney referenced this in commit 9e6ac13a5d on Mar 19, 2014
  12. 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-19 09:16 UTC

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