electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit b134f04fef62991e302185da44b1a53a0984f302
parent 9ecb50473924e89d3792086a078bd34ec2db8458
Author: SomberNight <somber.night@protonmail.com>
Date:   Fri,  1 Mar 2019 19:54:09 +0100

storage: fix convert_version_18

Diffstat:
Melectrum/json_db.py | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/electrum/json_db.py b/electrum/json_db.py @@ -105,6 +105,12 @@ class JsonDB(PrintError): self.data[key] = copy.deepcopy(value) return True elif key in self.data: + # clear current contents in case of references + cur_val = self.data[key] + clear_method = getattr(cur_val, "clear", None) + if callable(clear_method): + clear_method() + # pop from dict to delete key self.data.pop(key) return True return False