gat_wallet_delta: reverse sign of returned fee

This commit is contained in:
ThomasV 2016-06-02 11:30:39 +02:00
parent 79fbb5edce
commit 0843aaafb5
4 changed files with 5 additions and 6 deletions

View File

@ -127,8 +127,8 @@ class TxDialog(Factory.Popup):
if is_relevant:
if is_mine:
if fee is not None:
self.amount_str = self.app.format_amount_and_units(-v+fee)
self.fee_str = self.app.format_amount_and_units(-fee)
self.amount_str = self.app.format_amount_and_units(-v-fee)
self.fee_str = self.app.format_amount_and_units(fee)
else:
self.amount_str = self.app.format_amount_and_units(-v)
self.fee_str = _("unknown")

View File

@ -2711,7 +2711,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
def bump_fee_dialog(self, tx):
is_relevant, is_mine, v, fee = self.wallet.get_wallet_delta(tx)
fee = -fee
d = WindowModalDialog(self, _('Bump Fee'))
vbox = QVBoxLayout(d)
vbox.addWidget(QLabel(_('Current fee') + ': %s'% self.format_amount(fee) + ' ' + self.base_unit()))

View File

@ -234,7 +234,7 @@ class TxDialog(QDialog, MessageBoxMixin):
if is_relevant:
if is_mine:
if fee is not None:
amount_str = _("Amount sent:") + ' %s'% format_amount(-v+fee) + ' ' + base_unit
amount_str = _("Amount sent:") + ' %s'% format_amount(-v-fee) + ' ' + base_unit
else:
amount_str = _("Amount sent:") + ' %s'% format_amount(-v) + ' ' + base_unit
else:
@ -244,7 +244,7 @@ class TxDialog(QDialog, MessageBoxMixin):
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'))
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)

View File

@ -596,7 +596,7 @@ class Abstract_Wallet(PrintError):
fee = None
else:
# all inputs are mine
fee = v_out - v_in
fee = v_in - v_out
if not is_mine:
fee = None
return is_relevant, is_mine, v, fee