1
0

storage/blockchain: use os.replace

This commit is contained in:
SomberNight
2018-11-30 04:08:02 +01:00
parent 863ee984fe
commit bddea809ec
2 changed files with 2 additions and 11 deletions

View File

@@ -352,11 +352,7 @@ class Blockchain(util.PrintError):
self._forkpoint_hash, parent._forkpoint_hash = parent._forkpoint_hash, hash_raw_header(bh2u(parent_data[:HEADER_SIZE]))
self._prev_hash, parent._prev_hash = parent._prev_hash, self._prev_hash
# parent's new name
try:
os.rename(child_old_name, parent.path())
except OSError:
os.remove(parent.path())
os.rename(child_old_name, parent.path())
os.replace(child_old_name, parent.path())
self.update_size()
parent.update_size()
# update pointers