aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-01-26 11:30:25 -0800
committerAdam Soltys <[email protected]>2024-01-26 11:30:25 -0800
commit2be8d6816f46eb1b980573a13079a072a91acb36 (patch)
tree6eb3e074fd799be589de92edfda7c28c43b29abd /lib/utils.js
parent328bab418d727182086f1df3bd5e3de6aa1b1fcf (diff)
downloadcoinos-server-2be8d6816f46eb1b980573a13079a072a91acb36.tar.gz
coinos-server-2be8d6816f46eb1b980573a13079a072a91acb36.zip
track seen payments in zset
Diffstat (limited to 'lib/utils.js')
-rw-r--r--lib/utils.js7
1 files changed, 7 insertions, 0 deletions
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}`);
+}