From 72902b574d1e9ed4669878bc68fd284bf49b6e98 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 23 Feb 2024 12:56:52 -0800 Subject: constrain memo length --- lib/payments.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/payments.js') diff --git a/lib/payments.js b/lib/payments.js index 54c901e6..ea17783b 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -132,6 +132,7 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { tip = parseInt(tip) || 0; if (!memo) ({ memo } = inv); + if (memo && memo.length > 200) fail("memo too long"); if (amount < 0 || tip < 0) fail("Invalid amount"); if (type === types.internal) amount += tip; -- cgit v1.2.3