aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/lnurl.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/routes/lnurl.ts b/routes/lnurl.ts
index 1acc4d76..1b3f84c1 100644
--- a/routes/lnurl.ts
+++ b/routes/lnurl.ts
@@ -188,7 +188,10 @@ export default {
});
if (comment) {
- invoice.memo = comment;
+ // Enforce the commentAllowed:512 we advertise in the lnurlp response.
+ // This overwrite happens after generate()'s own memo validation, so an
+ // uncapped comment would otherwise reach credit() at settlement time.
+ invoice.memo = String(comment).slice(0, 512);
await s(`invoice:${invoice.id}`, invoice);
}