1
0

simplify prev

This commit is contained in:
SomberNight
2020-10-07 20:39:00 +02:00
parent 05ebd0f5b2
commit d3eefefed4

View File

@@ -87,12 +87,10 @@ class WalletStorage(Logger):
f.flush() f.flush()
os.fsync(f.fileno()) os.fsync(f.fileno())
default_mode = stat.S_IREAD | stat.S_IWRITE
try: try:
mode = os.stat(self.path).st_mode if self.file_exists() else default_mode mode = os.stat(self.path).st_mode
except FileNotFoundError: except FileNotFoundError:
# user might have deleted/renamed file while running mode = stat.S_IREAD | stat.S_IWRITE
mode = default_mode
# assert that wallet file does not exist, to prevent wallet corruption (see issue #5082) # assert that wallet file does not exist, to prevent wallet corruption (see issue #5082)
if not self.file_exists(): if not self.file_exists():