qt send: use bolt11 fallback addr even if LN is disabled
Given a wallet with LN disabled, and a bolt11 invoice (or a bip21 uri that only contains bolt11 but lacks a top-level address), if the bolt11 invoice includes a fallback address, we would previously just error "Lightning is disabled". Now we offer the user to pay on-chain using the fallback address. closes https://github.com/spesmilo/electrum/issues/8047
This commit is contained in:
@@ -136,6 +136,12 @@ class Invoice(StoredObject):
|
||||
outputs = self.outputs
|
||||
return outputs
|
||||
|
||||
def can_be_paid_onchain(self) -> bool:
|
||||
if self.is_lightning():
|
||||
return bool(self._lnaddr.get_fallback_address())
|
||||
else:
|
||||
return True
|
||||
|
||||
def get_expiration_date(self):
|
||||
# 0 means never
|
||||
return self.exp + self.time if self.exp else 0
|
||||
|
||||
Reference in New Issue
Block a user