Skip to content

Commit 5b1686b

Browse files
committed
wallet: close storage DB after create/restore
do not trigger synchronize from adb events, because it may access the DB once it has been closed.
1 parent 3e07c4d commit 5b1686b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

electrum/wallet.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,7 @@ def clear_tx_parents_cache(self):
614614
async def on_event_adb_set_up_to_date(self, adb):
615615
if self.adb != adb:
616616
return
617-
num_new_addrs = await run_in_thread(self.synchronize)
618-
up_to_date = self.adb.is_up_to_date() and num_new_addrs == 0
617+
up_to_date = self.adb.is_up_to_date()
619618
with self.lock:
620619
status_changed = self._up_to_date != up_to_date
621620
self._up_to_date = up_to_date
@@ -4448,7 +4447,7 @@ def create_new_wallet(
44484447
if not encrypt_file:
44494448
msg += "\nWarning: wallet file not encrypted. Lightning keys will not be encrypted on disk"
44504449
wallet.save_db()
4451-
#storage.close()
4450+
storage.close()
44524451
return {'seed': seed, 'wallet': wallet, 'msg': msg}
44534452

44544453

@@ -4526,5 +4525,5 @@ def restore_wallet_from_text(
45264525
if not encrypt_file:
45274526
msg += "\nWarning: wallet file not encrypted. Lightning keys will not be encrypted on disk."
45284527
wallet.save_db()
4529-
#storage.close()
4528+
storage.close()
45304529
return {'wallet': wallet, 'msg': msg}

0 commit comments

Comments
 (0)