invoices: only skip generating BIP21 URI for payment request if both amount and message are empty.
This will result in only showing a bare address QR in the GUIs iff both amount and message are left empty.
This commit is contained in:
@@ -344,10 +344,11 @@ class Request(BaseInvoice):
|
||||
) -> Optional[str]:
|
||||
addr = self.get_address()
|
||||
amount = self.get_amount_sat()
|
||||
if amount is None:
|
||||
return
|
||||
amount = int(amount)
|
||||
message = self.message
|
||||
if amount is None and not message:
|
||||
return
|
||||
if amount:
|
||||
amount = int(amount)
|
||||
extra = {}
|
||||
if self.time and self.exp:
|
||||
extra['time'] = str(int(self.time))
|
||||
|
||||
Reference in New Issue
Block a user