Browse Source

rename is_send -> is_mine

283
ThomasV 9 years ago
parent
commit
403fbdd39e
  1. 17
      gui/qt/transaction_dialog.py
  2. 12
      lib/wallet.py

17
gui/qt/transaction_dialog.py

@ -234,15 +234,20 @@ class TxDialog(QDialog, MessageBoxMixin):
if is_relevant:
if is_mine:
if fee is not None:
self.amount_label.setText(_("Amount sent:")+' %s'% format_amount(-v+fee) + ' ' + base_unit)
self.fee_label.setText(_("Transaction fee")+': %s'% format_amount(-fee) + ' ' + base_unit)
amount_str = _("Amount sent:") + ' %s'% format_amount(-v+fee) + ' ' + base_unit
else:
self.amount_label.setText(_("Amount sent:")+' %s'% format_amount(-v) + ' ' + base_unit)
self.fee_label.setText(_("Transaction fee")+': '+ _("unknown"))
amount_str = _("Amount sent:") + ' %s'% format_amount(-v) + ' ' + base_unit
else:
self.amount_label.setText(_("Amount received:")+' %s'% format_amount(v) + ' ' + base_unit)
amount_str = _("Amount received:") + ' %s'% format_amount(v) + ' ' + base_unit
else:
self.amount_label.setText(_("Transaction unrelated to your wallet"))
amount_str = _("Transaction unrelated to your wallet")
if fee is None:
fee = self.wallet.tx_fees.get(tx_hash)
fee_str = _("Transaction fee") + ': %s'% (format_amount(-fee) + ' ' + base_unit if fee is not None else _('unknown'))
self.amount_label.setText(amount_str)
self.fee_label.setText(fee_str)
run_hook('transaction_dialog_update', self)

12
lib/wallet.py

@ -552,14 +552,14 @@ class Abstract_Wallet(PrintError):
""" effect of tx on wallet """
addresses = self.addresses(True)
is_relevant = False
is_send = False
is_mine = False
is_pruned = False
is_partial = False
v_in = v_out = v_out_mine = 0
for item in tx.inputs():
addr = item.get('address')
if addr in addresses:
is_send = True
is_mine = True
is_relevant = True
d = self.txo.get(item['prevout_hash'], {}).get(addr, [])
for n, v, cb in d:
@ -574,7 +574,7 @@ class Abstract_Wallet(PrintError):
v_in += value
else:
is_partial = True
if not is_send:
if not is_mine:
is_partial = False
for addr, value in tx.get_outputs():
v_out += value
@ -584,7 +584,7 @@ class Abstract_Wallet(PrintError):
if is_pruned:
# some inputs are mine:
fee = None
if is_send:
if is_mine:
v = v_out_mine - v_out
else:
# no input is mine
@ -594,11 +594,11 @@ class Abstract_Wallet(PrintError):
if is_partial:
# some inputs are mine, but not all
fee = None
is_send = v < 0
is_mine = v < 0
else:
# all inputs are mine
fee = v_out - v_in
return is_relevant, is_send, v, fee
return is_relevant, is_mine, v, fee
def get_addr_io(self, address):
h = self.history.get(address, [])

Loading…
Cancel
Save