check for amountless invoices deeper in the call stack (#1536)

This commit is contained in:
calle 2023-02-22 13:30:45 +01:00 committed by GitHub
parent 0d5fef1cb9
commit f7e43cdd95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,6 +69,10 @@ async def create_invoice(
internal: Optional[bool] = False, internal: Optional[bool] = False,
conn: Optional[Connection] = None, conn: Optional[Connection] = None,
) -> Tuple[str, str]: ) -> Tuple[str, str]:
if not amount > 0:
raise InvoiceFailure("Amountless invoices not supported.")
invoice_memo = None if description_hash else memo invoice_memo = None if description_hash else memo
# use the fake wallet if the invoice is for internal use only # use the fake wallet if the invoice is for internal use only