Browse Source

qt: add missing case for on-chain fallback for BIP21 payment identfier containing lightning invoice

master
Sander van Grieken 2 years ago
parent
commit
6ce8a583fd
  1. 2
      electrum/gui/qt/send_tab.py
  2. 2
      electrum/payment_identifier.py

2
electrum/gui/qt/send_tab.py

@ -698,6 +698,8 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
num_sats_can_send = int(lnworker.num_sats_can_send())
msg += '\n' + _('Your channels can send {}.').format(self.format_amount(num_sats_can_send) + ' ' + self.base_unit())
if not choices:
if not can_pay_onchain:
msg += '\n' + _('Also, you have insufficient funds to pay on-chain.')
self.window.show_error(msg)
return
r = self.window.query_choice(msg, choices)

2
electrum/payment_identifier.py

@ -173,6 +173,8 @@ class PaymentIdentifier(Logger):
return True
if self._type in [PaymentIdentifierType.LNURLP, PaymentIdentifierType.BOLT11, PaymentIdentifierType.LNADDR]:
return bool(self.bolt11) and bool(self.bolt11.get_address())
if self._type == PaymentIdentifierType.BIP21:
return bool(self.bip21.get('address', None)) or (bool(self.bolt11) and bool(self.bolt11.get_address()))
def is_multiline(self):
return bool(self.multiline_outputs)

Loading…
Cancel
Save