Browse Source

send_tab: simplify lock_max

master
Sander van Grieken 3 years ago
parent
commit
febb2222d4
  1. 7
      electrum/gui/qt/send_tab.py

7
electrum/gui/qt/send_tab.py

@ -382,10 +382,7 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
and not (pi.type in [PaymentIdentifierType.EMAILLIKE, PaymentIdentifierType.DOMAINLIKE] \ and not (pi.type in [PaymentIdentifierType.EMAILLIKE, PaymentIdentifierType.DOMAINLIKE] \
and pi.state in [PaymentIdentifierState.NOT_FOUND, PaymentIdentifierState.NEED_RESOLVE]) and pi.state in [PaymentIdentifierState.NOT_FOUND, PaymentIdentifierState.NEED_RESOLVE])
lock_amount = pi.is_amount_locked() lock_amount = pi.is_amount_locked()
lock_max = lock_amount \ lock_max = lock_amount or pi.type not in [PaymentIdentifierType.SPK, PaymentIdentifierType.BIP21]
or pi.type in [PaymentIdentifierType.BOLT11, PaymentIdentifierType.LNURLP,
PaymentIdentifierType.LNADDR, PaymentIdentifierType.EMAILLIKE,
PaymentIdentifierType.DOMAINLIKE]
self.lock_fields(lock_recipient=lock_recipient, self.lock_fields(lock_recipient=lock_recipient,
lock_amount=lock_amount, lock_amount=lock_amount,
@ -416,7 +413,7 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
self.amount_e.setToolTip('') self.amount_e.setToolTip('')
self.send_button.setEnabled(bool(self.amount_e.get_amount()) and not pi.has_expired() and not pi.is_error()) self.send_button.setEnabled(bool(self.amount_e.get_amount()) and not pi.has_expired() and not pi.is_error())
self.save_button.setEnabled(not pi.is_error() and not pi.type in [PaymentIdentifierType.LNURLP, PaymentIdentifierType.LNADDR]) self.save_button.setEnabled(not pi.is_error() and pi.type not in [PaymentIdentifierType.LNURLP, PaymentIdentifierType.LNADDR])
def _handle_payment_identifier(self): def _handle_payment_identifier(self):
self.update_fields() self.update_fields()

Loading…
Cancel
Save