URI: 
       tstorage: take the DB lock when writing to disk. - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 63963323be8052fc19e51ce15e50ea9bcc1a955f
   DIR parent 73e656522e06be1989b95855f79aefec1cb0e006
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Mon,  3 Feb 2020 17:08:34 +0100
       
       storage: take the DB lock when writing to disk.
       
       Diffstat:
         M electrum/json_db.py                 |       3 ---
         M electrum/storage.py                 |       4 +---
       
       2 files changed, 1 insertion(+), 6 deletions(-)
       ---
   DIR diff --git a/electrum/json_db.py b/electrum/json_db.py
       t@@ -61,9 +61,6 @@ class JsonDB(Logger):
                    return True
                return False
        
       -    def commit(self):
       -        pass
       -
            @locked
            def dump(self):
                return json.dumps(self.data, indent=4, sort_keys=True, cls=JsonDBJsonEncoder)
   DIR diff --git a/electrum/storage.py b/electrum/storage.py
       t@@ -57,7 +57,6 @@ class WalletStorage(Logger):
        
            def __init__(self, path, *, manual_upgrades: bool = False):
                Logger.__init__(self)
       -        self.lock = threading.RLock()
                self.path = standardize_path(path)
                self._file_exists = bool(self.path and os.path.exists(self.path))
                self._manual_upgrades = manual_upgrades
       t@@ -112,7 +111,7 @@ class WalletStorage(Logger):
        
            @profiler
            def write(self):
       -        with self.lock:
       +        with self.db.lock:
                    self._write()
        
            def _write(self):
       t@@ -121,7 +120,6 @@ class WalletStorage(Logger):
                    return
                if not self.db.modified():
                    return
       -        self.db.commit()
                s = self.encrypt_before_writing(self.db.dump())
                temp_path = "%s.tmp.%s" % (self.path, os.getpid())
                with open(temp_path, "w", encoding='utf-8') as f: