CDataStream::ignore Throw exception instead of assert on negative nSize. #7936

pull pstratem wants to merge 1 commits into bitcoin:master from pstratem:2016-04-24-cdatastream-ignore changing 1 files +3 −1
  1. pstratem commented at 7:11 AM on April 25, 2016: contributor

    Previously disk corruption would cause an assert instead of an exception.

    This has not been extensively reviewed.

  2. jonasschnelli added the label Refactoring on Apr 25, 2016
  3. pstratem force-pushed on Apr 25, 2016
  4. CDataStream::ignore Throw exception instead of assert on negative nSize.
    Previously disk corruption would cause an assert instead of an exception.
    2ed0ca42f7
  5. laanwj commented at 8:45 AM on April 25, 2016: member

    Concept ACK.

    How do the call-sites of this function cope with this exception? I suppose this is only used in reindexing?

  6. sipa commented at 12:05 PM on April 25, 2016: member

    There are actually no call sites for this before #7933...

  7. pstratem commented at 12:17 PM on April 25, 2016: contributor

    CDataStream::ignore -> CScriptCompressor::Unserialize -> CTxOutCompressor::SerializationOp

    CCoins::GetSerializeSize,Serialize,Unserialize CTxInUndo::GetSerializeSize,Serialize,Unserialize

    Still working on what calls those...

  8. pstratem renamed this:
    CDataStream::ignore Throw exception instead of assert on negative nSize.
    [WIP] CDataStream::ignore Throw exception instead of assert on negative nSize.
    on Apr 25, 2016
  9. pstratem renamed this:
    [WIP] CDataStream::ignore Throw exception instead of assert on negative nSize.
    CDataStream::ignore Throw exception instead of assert on negative nSize.
    on Apr 25, 2016
  10. sipa commented at 12:48 PM on April 25, 2016: member

    @pstratem I believe it is. I'm going to include it in #7933, as without it, the test I'm adding for it fails...

  11. pstratem commented at 12:52 PM on April 25, 2016: contributor

    @sipa Indeed since this can only be triggered by disk corruption... all bets are off anyways

  12. laanwj commented at 11:25 AM on April 26, 2016: member

    Merged as part of #7933

  13. laanwj closed this on Apr 26, 2016

  14. MarcoFalke locked this on Sep 8, 2021
Contributors

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-17 09:15 UTC

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