diff options
| author | Adam Soltys <[email protected]> | 2024-01-26 11:30:25 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-01-26 11:30:25 -0800 |
| commit | 2be8d6816f46eb1b980573a13079a072a91acb36 (patch) | |
| tree | 6eb3e074fd799be589de92edfda7c28c43b29abd /lib/utils.js | |
| parent | 328bab418d727182086f1df3bd5e3de6aa1b1fcf (diff) | |
| download | coinos-server-2be8d6816f46eb1b980573a13079a072a91acb36.tar.gz coinos-server-2be8d6816f46eb1b980573a13079a072a91acb36.zip | |
track seen payments in zset
Diffstat (limited to 'lib/utils.js')
| -rw-r--r-- | lib/utils.js | 7 |
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}`); +} |
