Merge pull request #1234 from kyuupichan/storage-tmpfile

Prevent race with two electrum instances on same wallet.
This commit is contained in:
ThomasV 2015-05-23 07:22:12 +02:00
commit 4aaa9e24f2
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ class WalletStorage(object):
def write(self):
assert not threading.currentThread().isDaemon()
temp_path = self.path + '.tmp'
temp_path = "%s.tmp.%s" % (self.path, os.getpid())
s = json.dumps(self.data, indent=4, sort_keys=True)
with open(temp_path, "w") as f:
f.write(s)