post-storage_db-merge fixups

This commit is contained in:
SomberNight 2019-03-01 14:14:30 +01:00
parent d0fa3b431a
commit 8b2c586d30
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
5 changed files with 10 additions and 8 deletions

View file

@ -665,7 +665,7 @@ class Commands:
tx = Transaction(tx)
if not self.wallet.add_transaction(tx.txid(), tx):
return False
self.wallet.save_transactions()
self.wallet.storage.write()
return tx.txid()
@command('wp')
@ -735,7 +735,7 @@ class Commands:
to_delete |= self.wallet.get_depending_transactions(txid)
for tx_hash in to_delete:
self.wallet.remove_transaction(tx_hash)
self.wallet.save_transactions(write=True)
self.wallet.storage.write()
@command('')
def help(self):

View file

@ -118,7 +118,7 @@ class HistoryScreen(CScreen):
def show_tx(self, obj):
tx_hash = obj.tx_hash
tx = self.app.wallet.transactions.get(tx_hash)
tx = self.app.wallet.db.get_transaction(tx_hash)
if not tx:
return
self.app.tx_dialog(tx)

View file

@ -547,7 +547,7 @@ class HistoryList(MyTreeView, AcceptFileDragDrop):
self.show_transaction(tx_item['txid'])
def show_transaction(self, tx_hash):
tx = self.wallet.transactions.get(tx_hash)
tx = self.wallet.db.get_transaction(tx_hash)
if not tx:
return
label = self.wallet.get_label(tx_hash) or None # prefer 'None' if not defined (force tx dialog to hide Description field if missing)
@ -568,7 +568,9 @@ class HistoryList(MyTreeView, AcceptFileDragDrop):
column_title = self.hm.headerData(column, Qt.Horizontal, Qt.DisplayRole)
column_data = self.hm.data(idx, Qt.DisplayRole).value()
tx_hash = tx_item['txid']
tx = self.wallet.transactions[tx_hash]
tx = self.wallet.db.get_transaction(tx_hash)
if not tx:
return
tx_URL = block_explorer_URL(self.config, 'tx', tx_hash)
height = self.wallet.get_tx_height(tx_hash).height
is_relevant, is_mine, v, fee = self.wallet.get_wallet_delta(tx)
@ -613,7 +615,7 @@ class HistoryList(MyTreeView, AcceptFileDragDrop):
return
for tx in to_delete:
self.wallet.remove_transaction(tx)
self.wallet.save_transactions(write=True)
self.wallet.storage.write()
# need to update at least: history_list, utxo_list, address_list
self.parent.need_update.set()

View file

@ -3363,7 +3363,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
win.show_error(e)
return False
else:
self.wallet.save_transactions(write=True)
self.wallet.storage.write()
# need to update at least: history_list, utxo_list, address_list
self.need_update.set()
msg = (_("Transaction added to wallet history.") + '\n\n' +

View file

@ -107,7 +107,7 @@ class UTXOList(MyTreeView):
menu.addAction(_("Spend"), lambda: self.parent.spend_coins(coins))
if len(selected) == 1:
txid = selected[0].split(':')[0]
tx = self.wallet.transactions.get(txid)
tx = self.wallet.db.get_transaction(txid)
if tx:
label = self.wallet.get_label(txid) or None # Prefer None if empty (None hides the Description: field in the window)
menu.addAction(_("Details"), lambda: self.parent.show_transaction(tx, label))