From 2be8d6816f46eb1b980573a13079a072a91acb36 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 26 Jan 2024 11:30:25 -0800 Subject: track seen payments in zset --- lib/utils.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/utils.js') diff --git a/lib/utils.js b/lib/utils.js index 866bbaf9..c68d222b 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -69,3 +69,10 @@ export let getUser = async (username) => { if (username === "undefined") fail("invalid user"); return migrate(username); }; + +export let getInvoice = async (hash) => { + let iid = await g(`invoice:${hash}`); + if (iid && iid.id) iid = iid.id; + else if (iid && iid.hash) iid = iid.hash; + return await g(`invoice:${iid}`); +} -- cgit v1.2.3