aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-04-12 04:37:34 +0000
committerAdam Soltys <[email protected]>2023-04-12 04:37:39 +0000
commit36cdac82d7b52c6ea02b81afc93ebe2f5f743047 (patch)
tree348fcb33def6eecf63716d8e53c07f5fbea4813d
parentcff0420fa6486ada0105f71af74351533a3c496a (diff)
downloadcoinos-server-36cdac82d7b52c6ea02b81afc93ebe2f5f743047.tar.gz
coinos-server-36cdac82d7b52c6ea02b81afc93ebe2f5f743047.zip
limit payments to 5s
-rw-r--r--routes/payments.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 571d84f4..bd42ef59 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -71,10 +71,13 @@ export default {
let r;
try {
+ l("paying lightning invoice", payreq);
+
r = await ln.pay({
bolt11: payreq.replace(/\s/g, "").toLowerCase(),
amount_msat: msatoshi ? undefined : `${amount}sats`,
- maxfee
+ maxfee,
+ retry_for: 5
});
if (r.status !== "complete") fail("payment did not complete");
@@ -86,7 +89,7 @@ export default {
await s(`payment:${p.id}`, p);
- l("refunding fee", maxfee, p.fee, maxfee - p.fee);
+ l("refunding fee", maxfee, p.fee, maxfee - p.fee, p.ref);
await db.incrBy(`balance:${p.uid}`, maxfee - p.fee);
} catch (e) {
warn("something went wrong", e.message);