follow-up cefa4762ba
This commit is contained in:
@@ -193,7 +193,7 @@ class Plugin(TrustedCoinPlugin):
|
|||||||
vbox.addLayout(grid)
|
vbox.addLayout(grid)
|
||||||
|
|
||||||
price_per_tx = wallet.price_per_tx
|
price_per_tx = wallet.price_per_tx
|
||||||
n_prepay = wallet.num_prepay(self.config)
|
n_prepay = wallet.num_prepay()
|
||||||
i = 0
|
i = 0
|
||||||
for k, v in sorted(price_per_tx.items()):
|
for k, v in sorted(price_per_tx.items()):
|
||||||
if k == 1:
|
if k == 1:
|
||||||
|
|||||||
@@ -291,14 +291,14 @@ class Wallet_2fa(Multisig_Wallet):
|
|||||||
def min_prepay(self):
|
def min_prepay(self):
|
||||||
return min(self.price_per_tx.keys())
|
return min(self.price_per_tx.keys())
|
||||||
|
|
||||||
def num_prepay(self, config):
|
def num_prepay(self):
|
||||||
default = self.min_prepay()
|
default = self.min_prepay()
|
||||||
n = config.get('trustedcoin_prepay', default)
|
n = self.config.get('trustedcoin_prepay', default)
|
||||||
if n not in self.price_per_tx:
|
if n not in self.price_per_tx:
|
||||||
n = default
|
n = default
|
||||||
return n
|
return n
|
||||||
|
|
||||||
def extra_fee(self, config):
|
def extra_fee(self):
|
||||||
if self.can_sign_without_server():
|
if self.can_sign_without_server():
|
||||||
return 0
|
return 0
|
||||||
if self.billing_info is None:
|
if self.billing_info is None:
|
||||||
@@ -308,17 +308,17 @@ class Wallet_2fa(Multisig_Wallet):
|
|||||||
return 0
|
return 0
|
||||||
if self.is_billing:
|
if self.is_billing:
|
||||||
return 0
|
return 0
|
||||||
n = self.num_prepay(config)
|
n = self.num_prepay()
|
||||||
price = int(self.price_per_tx[n])
|
price = int(self.price_per_tx[n])
|
||||||
if price > 100000 * n:
|
if price > 100000 * n:
|
||||||
raise Exception('too high trustedcoin fee ({} for {} txns)'.format(price, n))
|
raise Exception('too high trustedcoin fee ({} for {} txns)'.format(price, n))
|
||||||
return price
|
return price
|
||||||
|
|
||||||
def make_unsigned_transaction(self, coins, outputs, config, fixed_fee=None,
|
def make_unsigned_transaction(self, coins, outputs, fixed_fee=None,
|
||||||
change_addr=None, is_sweep=False):
|
change_addr=None, is_sweep=False):
|
||||||
mk_tx = lambda o: Multisig_Wallet.make_unsigned_transaction(
|
mk_tx = lambda o: Multisig_Wallet.make_unsigned_transaction(
|
||||||
self, coins, o, config, fixed_fee, change_addr)
|
self, coins, o, fixed_fee, change_addr)
|
||||||
fee = self.extra_fee(config) if not is_sweep else 0
|
fee = self.extra_fee() if not is_sweep else 0
|
||||||
if fee:
|
if fee:
|
||||||
address = self.billing_info['billing_address_segwit']
|
address = self.billing_info['billing_address_segwit']
|
||||||
fee_output = TxOutput(TYPE_ADDRESS, address, fee)
|
fee_output = TxOutput(TYPE_ADDRESS, address, fee)
|
||||||
|
|||||||
Reference in New Issue
Block a user