trustedcoin: restore the display of fees
This commit is contained in:
parent
eb36884c66
commit
5aa0a87d7a
|
@ -1245,12 +1245,18 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
confirm_amount = self.config.get('confirm_amount', COIN)
|
confirm_amount = self.config.get('confirm_amount', COIN)
|
||||||
msg = [
|
msg = [
|
||||||
_("Amount to be sent") + ": " + self.format_amount_and_units(amount),
|
_("Amount to be sent") + ": " + self.format_amount_and_units(amount),
|
||||||
_("Transaction fee") + ": " + self.format_amount_and_units(fee),
|
_("Mining fee") + ": " + self.format_amount_and_units(fee),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
extra_fee = run_hook('get_additional_fee', self.wallet, tx)
|
||||||
|
if extra_fee:
|
||||||
|
msg.append( _("Additional fees") + ": " + self.format_amount_and_units(extra_fee) )
|
||||||
|
|
||||||
if tx.get_fee() >= self.config.get('confirm_fee', 100000):
|
if tx.get_fee() >= self.config.get('confirm_fee', 100000):
|
||||||
msg.append(_('Warning')+ ': ' + _("The fee for this transaction seems unusually high."))
|
msg.append(_('Warning')+ ': ' + _("The fee for this transaction seems unusually high."))
|
||||||
|
|
||||||
if self.wallet.use_encryption:
|
if self.wallet.use_encryption:
|
||||||
|
msg.append("")
|
||||||
msg.append(_("Enter your password to proceed"))
|
msg.append(_("Enter your password to proceed"))
|
||||||
password = self.password_dialog('\n'.join(msg))
|
password = self.password_dialog('\n'.join(msg))
|
||||||
if not password:
|
if not password:
|
||||||
|
|
|
@ -307,6 +307,13 @@ class TrustedCoinPlugin(BasePlugin):
|
||||||
def is_enabled(self):
|
def is_enabled(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@hook
|
||||||
|
def get_additional_fee(self, wallet, tx):
|
||||||
|
address = wallet.billing_info['billing_address']
|
||||||
|
for _type, addr, amount in tx.outputs():
|
||||||
|
if _type == TYPE_ADDRESS and addr == address:
|
||||||
|
return amount
|
||||||
|
|
||||||
def request_billing_info(self, wallet):
|
def request_billing_info(self, wallet):
|
||||||
billing_info = server.get(wallet.get_user_id()[1])
|
billing_info = server.get(wallet.get_user_id()[1])
|
||||||
billing_address = make_billing_address(wallet, billing_info['billing_index'])
|
billing_address = make_billing_address(wallet, billing_info['billing_index'])
|
||||||
|
|
Loading…
Reference in New Issue