Skip to content

Commit

Permalink
safeguard: do not let daemon treads write wallet file
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasV committed Mar 24, 2015
1 parent 0200778 commit 1369c02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def put(self, key, value, save = True):
self.write()

def write(self):
assert not threading.currentThread().isDaemon()
s = json.dumps(self.data, indent=4, sort_keys=True)
with open(self.path,"w") as f:
f.write(s)
Expand Down

0 comments on commit 1369c02

Please sign in to comment.