aboutsummaryrefslogtreecommitdiffstats
path: root/lib/invoices.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-27 19:29:35 -0800
committerAdam Soltys <[email protected]>2023-02-27 19:29:38 -0800
commitea794b2a1c7679bcd0e053ef623c234ad3700fb0 (patch)
treec22ea57cec8491778953615eb4c7f52e2d018dd0 /lib/invoices.js
parent56d1bb6cde1f0ce8cac330f4fd68670312141af8 (diff)
downloadcoinos-server-ea794b2a1c7679bcd0e053ef623c234ad3700fb0.tar.gz
coinos-server-ea794b2a1c7679bcd0e053ef623c234ad3700fb0.zip
invoice fixes
Diffstat (limited to 'lib/invoices.js')
-rw-r--r--lib/invoices.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/invoices.js b/lib/invoices.js
index ddb378cf..f64cf409 100644
--- a/lib/invoices.js
+++ b/lib/invoices.js
@@ -29,9 +29,8 @@ export let generate = async ({ invoice, user, sender, memo }) => {
let hash, text;
if (type === types.lightning) {
- let amt = amount ? `${amount + tip}sat` : "any";
let r = await ln.invoice(
- amt,
+ amount ? `${amount + tip}sat` : "any",
new Date(),
memo || "",
3600,
@@ -54,16 +53,17 @@ export let generate = async ({ invoice, user, sender, memo }) => {
}
invoice = {
- ...invoice,
amount,
- hash,
- text,
+ created: Date.now(),
currency,
+ hash,
rate,
+ received: 0,
+ request_id,
+ text,
tip,
+ type,
uid,
- received: 0,
- created: Date.now()
};
l("creating invoice", user.username, amount, tip, currency, invoice.hash);