channeldb: check for tombstone before opening DB
To avoid running a channel DB that was successfully migrated to another system by accident, we check if there is a tombstone marker before we open the DB for use.
This commit is contained in:
2 files changed
+10
No files matched your search
@@ -681,4 +681,9 @@ func TestMarkerAndTombstone(t *testing.T) {
|
||||
// cannot be used anymore.
|
||||
err = db.View(EnsureNoTombstone, func() {})
|
||||
require.ErrorContains(t, err, string(tombstoneText))
|
||||
|
||||
// Now that the DB has a tombstone, we should no longer be able to open
|
||||
// it once we close it.
|
||||
_, err = CreateWithBackend(db.Backend)
|
||||
require.ErrorContains(t, err, string(tombstoneText))
|
||||
}
|
||||
Reference in new issue
Block a user