V.0.18.1. Regtest loses blocks after a crash. #19989

issue educob openend this issue on September 21, 2020
  1. educob commented at 8:38 am on September 21, 2020: none

    Hi.

    Everything is working ok, bitcoin node records and notifies new txs and new blocks which I record in a database. But when I restart my laptop after a crash, my database has more blocks than the blockchain.This time a couple of extra blocks. It happens almost everytime my computer crashes.

    What could be causing this? Maybe the latest blocks are not written to disk (kept in cache)? If this happens with testnet and mainnet is not a problemn for my app cause any missing blocks on the node would be retrived from the blockchain which is not the case in my solitary regtest.

    Thanks.

  2. MarcoFalke commented at 8:00 pm on September 22, 2020: member
    How did you observe the difference? Are there debug log lines or similar?
  3. educob commented at 8:06 pm on September 22, 2020: none

    Hi. When my app starts it requests, by hash,from the node the last block on my database. If I shutdown my app when it restarts the node returns the last block on my database. But after a crash the node says it doesn’t have that block. I then send a getblockchaininfo to the node and realize that it has fewers blocks than my database (2 blocks the time I did it but sometimes more blocks).

    As my node is regtest, no other node sends the missing blocks so I am forced to delete the last blocks from my database (which is left in an inconsistent state with invalid transactions).

    Where could I find node logs?

    Thanks.

  4. adamjonas commented at 1:32 pm on July 26, 2022: member
    Closing given 0.18 has reached EOL and we haven’t seen further reports of this.
  5. adamjonas closed this on Jul 26, 2022

  6. bitcoin locked this on Jul 26, 2023

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: 2024-11-17 15:12 UTC

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