Browse Source

qml: fix send "flow with LN but not LN enabled AND having bip21 uri"

closes https://github.com/spesmilo/electrum/issues/8334
master
SomberNight 3 years ago
parent
commit
a8623f63bb
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 7
      electrum/gui/qml/qeinvoice.py

7
electrum/gui/qml/qeinvoice.py

@ -1,5 +1,5 @@
import threading
from typing import TYPE_CHECKING, Optional
from typing import TYPE_CHECKING, Optional, Dict, Any
import asyncio
from urllib.parse import urlparse
@ -552,7 +552,7 @@ class QEInvoiceParser(QEInvoice):
self.validationError.emit('no_lightning',_('Detected valid Lightning invoice, but Lightning not enabled for wallet and no fallback address found.'))
else:
self._logger.debug('flow with LN but not LN enabled AND having bip21 uri')
self.setValidOnchainInvoice(bip21['address'])
self._validateRecipient_bip21_onchain(bip21)
else:
self.setValidLightningInvoice(lninvoice)
if not self._wallet.wallet.lnworker.channels:
@ -561,6 +561,9 @@ class QEInvoiceParser(QEInvoice):
self.validationSuccess.emit()
else:
self._logger.debug('flow without LN but having bip21 uri')
self._validateRecipient_bip21_onchain(bip21)
def _validateRecipient_bip21_onchain(self, bip21: Dict[str, Any]) -> None:
if 'amount' not in bip21:
amount = 0
else:

Loading…
Cancel
Save