1
0

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

This commit is contained in:
Sander van Grieken
2023-11-02 10:24:37 +01:00
parent ccbac96f9a
commit 6ce8a583fd
2 changed files with 4 additions and 0 deletions

View File

@@ -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)

View File

@@ -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)