From 18814242ad055ecd6f9de1d23209958e12aee69c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 24 Sep 2021 02:19:30 -0400 Subject: always create account on issuance --- lib/send.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/send.js') 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); ({ -- cgit v1.2.3