diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/send.js | 8 | ||||
| -rw-r--r-- | lib/sync.js | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/send.js b/lib/send.js index 26709b61..77d954f6 100644 --- a/lib/send.js +++ b/lib/send.js @@ -9,7 +9,7 @@ import { conversionFeeReceiver } from "../routes/lightning/conversionFee"; import lnd from "$lib/lnd"; -import { pay } from "lightning"; +import { payViaPaymentRequest } from "lightning"; import { l, warn, err } from "$lib/logging"; export default async (amount, memo, hash, user) => { @@ -89,12 +89,10 @@ export default async (amount, memo, hash, user) => { let tokens; if (!payreq.satoshis) tokens = amount; - let m = await pay({ + let m = await payViaPaymentRequest({ lnd, - tokens, request: hash, - max_paths: 10, - max_fee: { fixed: Math.min(10000, account.balance) } + max_fee: Math.min(10000, account.balance) }); if (!m) throw new Error(`lightning payment failed ${amount} ${hash}`); diff --git a/lib/sync.js b/lib/sync.js index 536bd582..62d13b24 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -75,12 +75,14 @@ const sync = async () => { ] }); - let { invoices } = await getInvoices({ lnd, limit: 200 }); + let { invoices } = await getInvoices({ lnd, limit: 1000 }); + let x = invoices.find(i => i.request.includes('lnbc10100u1p333l3lpp5znwsrpr9g')); + let cancelled = invoices.filter(i => i.is_canceled); let recent = invoices .filter( i => - i.secret && + i.is_confirmed && differenceInDays(new Date(), new Date(i.created_at)) < 2 ) .map(i => ({ |
