mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-27 15:31:31 +00:00
minor qt send tab fixes. notably 'send max' was broken
follow-up aaed594772
This commit is contained in:
parent
5e04f084b7
commit
0b87ce426f
3 changed files with 12 additions and 7 deletions
|
@ -148,6 +148,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
self.app = gui_object.app
|
||||
self.cleaned_up = False
|
||||
self.payment_request = None # type: Optional[paymentrequest.PaymentRequest]
|
||||
self.payto_URI = None
|
||||
self.checking_accounts = False
|
||||
self.qr_window = None
|
||||
self.not_enough_funds = False
|
||||
|
@ -1734,9 +1735,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
elif invoice['type'] == PR_TYPE_ONCHAIN:
|
||||
message = invoice['message']
|
||||
outputs = invoice['outputs']
|
||||
amount = sum(map(lambda x:x[2], outputs))
|
||||
else:
|
||||
raise Exception('unknowwn invoicce type')
|
||||
raise Exception('unknown invoice type')
|
||||
|
||||
if run_hook('abort_send', self):
|
||||
return
|
||||
|
@ -1760,7 +1760,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
self.show_message(str(e))
|
||||
return
|
||||
|
||||
amount = tx.output_value() if self.max_button.isChecked() else sum(map(lambda x:x[2], outputs))
|
||||
amount = tx.output_value() if self.max_button.isChecked() else sum(map(lambda x: x.value, outputs))
|
||||
fee = tx.get_fee()
|
||||
|
||||
use_rbf = bool(self.config.get('use_rbf', True))
|
||||
|
|
|
@ -585,12 +585,14 @@ def format_satoshis_plain(x, decimal_point = 8):
|
|||
return "{:.8f}".format(Decimal(x) / scale_factor).rstrip('0').rstrip('.')
|
||||
|
||||
|
||||
DECIMAL_POINT = localeconv()['decimal_point']
|
||||
DECIMAL_POINT = localeconv()['decimal_point'] # type: str
|
||||
|
||||
|
||||
def format_satoshis(x, num_zeros=0, decimal_point=8, precision=None, is_diff=False, whitespaces=False):
|
||||
def format_satoshis(x, num_zeros=0, decimal_point=8, precision=None, is_diff=False, whitespaces=False) -> str:
|
||||
if x is None:
|
||||
return 'unknown'
|
||||
if x == '!':
|
||||
return 'max'
|
||||
if precision is None:
|
||||
precision = decimal_point
|
||||
# format string
|
||||
|
|
|
@ -512,8 +512,11 @@ class Abstract_Wallet(AddressSynchronizer):
|
|||
'txpos_in_block': hist_item.tx_mined_status.txpos,
|
||||
}
|
||||
|
||||
def create_invoice(self, outputs, message, pr, URI):
|
||||
amount = sum(x[2] for x in outputs)
|
||||
def create_invoice(self, outputs: List[TxOutput], message, pr, URI):
|
||||
if '!' in (x.value for x in outputs):
|
||||
amount = '!'
|
||||
else:
|
||||
amount = sum(x.value for x in outputs)
|
||||
invoice = {
|
||||
'type': PR_TYPE_ONCHAIN,
|
||||
'message': message,
|
||||
|
|
Loading…
Add table
Reference in a new issue