aboutsummaryrefslogtreecommitdiffstats
path: root/lib/send.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-09-24 02:19:30 -0400
committerAdam Soltys <[email protected]>2021-09-24 02:19:30 -0400
commit18814242ad055ecd6f9de1d23209958e12aee69c (patch)
treef9abc8b8716b5587c8a71700df62ebfe2098f4f6 /lib/send.js
parentfd44b77a4ddac5beef34f65be8e5558f4b4291f9 (diff)
downloadcoinos-server-18814242ad055ecd6f9de1d23209958e12aee69c.tar.gz
coinos-server-18814242ad055ecd6f9de1d23209958e12aee69c.zip
always create account on issuance
Diffstat (limited to 'lib/send.js')
-rw-r--r--lib/send.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/send.js b/lib/send.js
index 293473d9..e08e9033 100644
--- a/lib/send.js
+++ b/lib/send.js
@@ -2,6 +2,8 @@ const bolt11 = require("bolt11");
const { Op } = require("sequelize");
send = async (amount, memo, hash, user) => {
+ l.info("attempting lightning payment", user.username, amount, hash);
+
let payreq = bolt11.decode(hash);
let routingInfo = payreq.tags.find(t => t.tagName === "routing_info");
if (
@@ -59,7 +61,7 @@ send = async (amount, memo, hash, user) => {
fee_limit: { fixed: Math.min(10000, account.balance) },
});
- if (!m) throw new Error("lightning payment failed");
+ if (!m) throw new Error(`lightning payment failed ${amount} ${hash}`);
if (m.payment_error) throw new Error(m.payment_error);
({