Blockchain gets corrupted if system crashes during initial download #605

issue EhVedadoOAnonimato opened this issue on November 4, 2011
  1. EhVedadoOAnonimato commented at 5:25 PM on November 4, 2011: none

    While doing the initial block download for a new installation of mine, my laptop battery ended and the system crashed suddenly. The blockchain files got corrupted and I couldn't start bitcoin anymore. I've written this here: https://bitcointalk.org/index.php?topic=46916.msg605718#msg605718

    Copying the relevant part of the linked message:

    "After I restart and tried to load the bitcoin client again, I got two error popups, with the following messages:

    First popup:

    EXCEPTION: NSt8ios_base7failureE
    CAutoFile::read : end of file
    bitcoin in AppInit()

    Second popup:

    EXCEPTION: NSt8ios_base7failureE
    CAutoFile::read : end of file
    bitcoin in CMyApp::OnUnhandledException()

    And after clicking OK to the second popup, nothing happens, bitcoin does not start."

    Workaround: Delete all block chain files and start over.

  2. laanwj commented at 5:31 PM on November 4, 2011: member

    Yes we should eventually add a more robust failure mode in case of corrupted block chain files (ie, re-download instead of crash)

  3. sipa commented at 6:16 PM on February 19, 2012: member

    Or even better: discard blkindex.dat, and reconstruct from whatever valid blocks can be reconstructed from blk0001.dat.

  4. rebroad commented at 8:22 AM on April 30, 2012: contributor

    I suggest we downgrade bitcoin's version to alpha until this is fixed.

  5. Diapolo commented at 9:28 AM on April 30, 2012: none

    As Bitcoin is experimental software I don't agree with you here. Is this bug reproduceable (with 0.6.1 RC1)?

  6. jgarzik commented at 10:01 PM on July 5, 2012: contributor

    Bitcoin should now be able to detect and work around this issue

  7. jgarzik closed this on Jul 5, 2012

  8. ptschip referenced this in commit 3542fcd625 on May 19, 2017
  9. Losangelosgenetics referenced this in commit b33d9a5159 on Mar 12, 2020
  10. KolbyML referenced this in commit bc86927231 on Sep 4, 2020
  11. 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-28 06:16 UTC

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