aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-05-21 14:05:02 -0400
committerAdam Soltys <[email protected]>2021-05-21 14:05:02 -0400
commit3ce9c73b1d4a281fe1475206d49c4f436e0b992e (patch)
tree8e8324d74761f164d9615a068a0f4f840506e642 /routes/lightning
parent37412d24f5c7b0c6d316ce240ef29cd4ccd2ca6d (diff)
downloadcoinos-server-3ce9c73b1d4a281fe1475206d49c4f436e0b992e.tar.gz
coinos-server-3ce9c73b1d4a281fe1475206d49c4f436e0b992e.zip
persist liquid conversion requests
Diffstat (limited to 'routes/lightning')
-rw-r--r--routes/lightning/receive.js10
1 files changed, 5 insertions, 5 deletions
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) {