backup: restore default filename lightningd.sqlite3

This commit is contained in:
Michael Schmoock
2020-11-30 15:45:15 +01:00
committed by Christian Decker
parent 9591c1b31e
commit be523aa54f
2 changed files with 26 additions and 1 deletions

View File

@@ -117,8 +117,12 @@ class Backend(object):
def restore(self, dest: str, remove_existing: bool = False):
"""Restore the backup in this backend to its former glory.
"""
If `dest` is a directory, we assume the default database filename:
lightningd.sqlite3
"""
if os.path.isdir(dest):
dest = os.path.join(dest, "lightningd.sqlite3")
if os.path.exists(dest):
if not remove_existing:
raise ValueError(