From 4f1605b6cb1c179f747213bfe0c6c1bca68c070f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 9 Oct 2023 05:42:04 -0700 Subject: fix internal payments --- lib/payments.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/payments.js b/lib/payments.js index 733e04ce..19cb5ce4 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -39,7 +39,7 @@ export let debit = async ( let rate = store.rates[currency]; let iid = await g(`invoice:${hash}`); - let invoice = await g(`invoice:${iid}`); + let invoice = typeof iid === "String" ? await g(`invoice:${iid}`) : iid; if (invoice) { ref = invoice.uid; @@ -116,7 +116,7 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { amount = parseInt(amount) || 0; let iid = await g(`invoice:${hash}`); - let invoice = await g(`invoice:${iid}`); + let invoice = typeof iid === "String" ? await g(`invoice:${iid}`) : iid; if (!invoice) return warn("failed to credit", hash, ", invoice not found"); let { tip } = invoice; -- cgit v1.2.3