Skip to content

Bug: Lost Blocks in Bitcoin-d after unclean node restart #614

@G8XSU

Description

@G8XSU

Describe the bug
After a block is mined, bitcoin-core does not immediately save it to disk.
But will broadcast it to clients. (in this case lightning nodes)

If bitcoin-node does not get cleanly stopped/restarted, that unpersisted block will be lost.
And when some client with previous block header tries to query it with blockhash, it will fail with "BlockNotFound"

To Reproduce
Steps to reproduce the behavior:
Mine a block then kill container or stop network.

Solution

  • Polar must stop bitcoin d via rpc stop in shutdown script, so that it persists and flushes all data to disk before exiting.
  • It also needs to be handled in clients consuming bitcoin blocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions