mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
parent
5d8d8f743a
commit
111ef9ebb1
5 changed files with 11 additions and 7 deletions
|
@ -294,7 +294,7 @@ class TxDialog(Factory.Popup):
|
|||
if b:
|
||||
for tx in to_delete:
|
||||
self.wallet.remove_transaction(tx)
|
||||
self.wallet.storage.write()
|
||||
self.wallet.save_db()
|
||||
self.app._trigger_update_wallet() # FIXME private...
|
||||
self.dismiss()
|
||||
d = Question(question, on_prompt)
|
||||
|
|
|
@ -666,7 +666,7 @@ class HistoryList(MyTreeView, AcceptFileDragDrop):
|
|||
return
|
||||
for tx in to_delete:
|
||||
self.wallet.remove_transaction(tx)
|
||||
self.wallet.storage.write()
|
||||
self.wallet.save_db()
|
||||
# need to update at least: history_list, utxo_list, address_list
|
||||
self.parent.need_update.set()
|
||||
|
||||
|
|
|
@ -3006,7 +3006,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
win.show_error(e)
|
||||
return False
|
||||
else:
|
||||
self.wallet.storage.write()
|
||||
self.wallet.save_db()
|
||||
# need to update at least: history_list, utxo_list, address_list
|
||||
self.need_update.set()
|
||||
msg = (_("Transaction added to wallet history.") + '\n\n' +
|
||||
|
|
|
@ -308,7 +308,7 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
|
|||
name = 'signed_%s.txn' % (tx.txid()[0:8])
|
||||
else:
|
||||
name = self.wallet.basename() + time.strftime('-%Y%m%d-%H%M.psbt')
|
||||
fileName = self.main_window.getSaveFileName(_("Select where to save your signed transaction"),
|
||||
fileName = self.main_window.getSaveFileName(_("Select where to save your transaction"),
|
||||
name,
|
||||
TRANSACTION_FILE_EXTENSION_FILTER)
|
||||
if not fileName:
|
||||
|
|
|
@ -28,7 +28,7 @@ import json
|
|||
import copy
|
||||
import threading
|
||||
from collections import defaultdict
|
||||
from typing import Dict, Optional, List, Tuple, Set, Iterable, NamedTuple, Sequence
|
||||
from typing import Dict, Optional, List, Tuple, Set, Iterable, NamedTuple, Sequence, TYPE_CHECKING
|
||||
import binascii
|
||||
|
||||
from . import util, bitcoin
|
||||
|
@ -41,6 +41,10 @@ from .lnutil import ChannelConstraints, Outpoint, ShachainElement
|
|||
from .json_db import StoredDict, JsonDB, locked, modifier
|
||||
from .plugin import run_hook, plugin_loaders
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .storage import WalletStorage
|
||||
|
||||
|
||||
# seed_version is now used for the version of the wallet file
|
||||
|
||||
OLD_SEED_VERSION = 4 # electrum versions < 2.0
|
||||
|
@ -998,11 +1002,11 @@ class WalletDB(JsonDB):
|
|||
v = binascii.unhexlify(v) if v is not None else None
|
||||
return v
|
||||
|
||||
def write(self, storage):
|
||||
def write(self, storage: 'WalletStorage'):
|
||||
with self.lock:
|
||||
self._write(storage)
|
||||
|
||||
def _write(self, storage):
|
||||
def _write(self, storage: 'WalletStorage'):
|
||||
if threading.currentThread().isDaemon():
|
||||
self.logger.warning('daemon thread cannot write db')
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue