diff options
| author | Adam Soltys <[email protected]> | 2023-10-09 05:42:04 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-10-09 05:42:04 -0700 |
| commit | 4f1605b6cb1c179f747213bfe0c6c1bca68c070f (patch) | |
| tree | 68172eda022e804a2bee651ea11144029d6bbd3a | |
| parent | db38e8f3316a121ba64d7e1c4cfd93b4826d6f4e (diff) | |
| download | coinos-server-4f1605b6cb1c179f747213bfe0c6c1bca68c070f.tar.gz coinos-server-4f1605b6cb1c179f747213bfe0c6c1bca68c070f.zip | |
fix internal payments
| -rw-r--r-- | lib/payments.js | 4 |
1 files changed, 2 insertions, 2 deletions
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; |
