From 3ce9c73b1d4a281fe1475206d49c4f436e0b992e Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 21 May 2021 14:05:02 -0400 Subject: persist liquid conversion requests --- routes/lightning/receive.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'routes/lightning') diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js index 325f7092..6b8a9077 100644 --- a/routes/lightning/receive.js +++ b/routes/lightning/receive.js @@ -18,7 +18,8 @@ const handlePayment = async msg => { const { text: hash, currency, memo, rate, tip, user_id } = invoice; const amount = parseInt(msg.amt_paid_sat) - tip; - if (amount > 10000000 || amount < 0) throw new Error("amount out of range"); + if (amount > 10000000 || amount < 0) + throw new Error("amount out of range"); account = await db.Account.findOne({ where: { @@ -82,18 +83,17 @@ const handlePayment = async msg => { let c = convert[msg.payment_request]; if (c) { - let { address, tx } = c; user.account = account; try { await sendLiquid({ - address, + address: c.address, + amount: total - 100, user, - tx, limit: total }); } catch (e) { - l.error("problem sending liquid payment"); + l.error("problem sending liquid payment", e.message, e.stack); } } } catch (e) { -- cgit v1.2.3