[fix] limit the size of the invoice description to 640 characters (#3045)
This commit is contained in:
parent
475ae5736e
commit
b8a5f3942c
2 changed files with 2 additions and 2 deletions
|
|
@ -198,7 +198,7 @@ class CreateInvoice(BaseModel):
|
|||
internal: bool = False
|
||||
out: bool = True
|
||||
amount: float = Query(None, ge=0)
|
||||
memo: str | None = None
|
||||
memo: str | None = Query(None, max_length=640)
|
||||
description_hash: str | None = None
|
||||
unhashed_description: str | None = None
|
||||
expiry: int | None = None
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ async def create_invoice(
|
|||
if not user_wallet:
|
||||
raise InvoiceError(f"Could not fetch wallet '{wallet_id}'.", status="failed")
|
||||
|
||||
invoice_memo = None if description_hash else memo
|
||||
invoice_memo = None if description_hash else memo[:640]
|
||||
|
||||
# use the fake wallet if the invoice is for internal use only
|
||||
funding_source = fake_wallet if internal else get_funding_source()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue