Commit 29be121
committed
Fix LevelDB stale LOCK recovery after crash or unclean shutdown
LevelDBStore::open() now handles stale LOCK files from crashed instances:
1. If Open fails, remove stale LOCK file and retry
2. If still fails (corruption), run RepairDB to salvage data, then retry
3. Only fatal-error if all recovery steps fail
All 6 LevelDB databases (sharechain, LTC/DOGE headers, LTC/DOGE UTXO,
found_blocks) funnel through this single open() path, so all are covered.
Matches the recovery approach used by Bitcoin Core / litecoind for their
LevelDB chainstate and block index databases.1 parent e20f386 commit 29be121
1 file changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
56 | 89 | | |
57 | 90 | | |
58 | 91 | | |
| |||
0 commit comments