aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/receive.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-09 10:27:32 -0400
committerAdam Soltys <[email protected]>2022-09-09 07:28:02 -0700
commitd2ae5acf545c8b1a4f88f87b8d80b20c9d45245d (patch)
tree153f3bb2b230de1a71927dd7535b5d48833fcaa8 /routes/lightning/receive.js
parent97779d3ca57785fa07dc15fd1860f26d17fac818 (diff)
downloadcoinos-server-d2ae5acf545c8b1a4f88f87b8d80b20c9d45245d.tar.gz
coinos-server-d2ae5acf545c8b1a4f88f87b8d80b20c9d45245d.zip
use actual received amount for lightning payments
Diffstat (limited to 'routes/lightning/receive.js')
-rw-r--r--routes/lightning/receive.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js
index 8141e5d3..3ecc4ce9 100644
--- a/routes/lightning/receive.js
+++ b/routes/lightning/receive.js
@@ -12,7 +12,7 @@ import { l, err, warn } from "$lib/logging";
const handlePayment = async msg => {
try {
- l("incoming lightning payment", msg.tokens, msg.request.substr(0,20));
+ l("incoming lightning payment", msg.received, msg.request.substr(0,20));
if (!msg.secret) return;
let account, total, user;
@@ -28,7 +28,7 @@ const handlePayment = async msg => {
await db.transaction(async transaction => {
const { text: hash, currency, memo, rate, tip, user_id } = invoice;
- const amount = parseInt(msg.tokens) - tip;
+ const amount = parseInt(msg.received) - tip;
if (amount < 0) throw new Error("amount out of range");
account = await db.Account.findOne({