aboutsummaryrefslogtreecommitdiffstats
path: root/lib/send.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-24 13:50:18 -0800
committerAdam Soltys <[email protected]>2022-11-24 13:50:18 -0800
commitc3f0689dc728b2ed86792ad180132165479c05d5 (patch)
tree5bb2778e60c411fe692190f03b960d5068024fd0 /lib/send.js
parent40e1723e0432d1656cbc5fbbd5e79a981d97809b (diff)
downloadcoinos-server-c3f0689dc728b2ed86792ad180132165479c05d5.tar.gz
coinos-server-c3f0689dc728b2ed86792ad180132165479c05d5.zip
remove lnd support
Diffstat (limited to 'lib/send.js')
-rw-r--r--lib/send.js27
1 files changed, 6 insertions, 21 deletions
diff --git a/lib/send.js b/lib/send.js
index 4f264509..54bcd103 100644
--- a/lib/send.js
+++ b/lib/send.js
@@ -8,9 +8,7 @@ import {
computeConversionFee,
conversionFeeReceiver
} from "../routes/lightning/conversionFee";
-import lnd from "$lib/lnd";
import ln from "$lib/ln";
-import { payViaPaymentRequest } from "lightning";
import { l, warn, err } from "$lib/logging";
export default async (amount, memo, hash, user) => {
@@ -90,25 +88,12 @@ export default async (amount, memo, hash, user) => {
if (!payreq.satoshis) tokens = amount;
let m;
- if (config.lna.lnd) {
- m = await payViaPaymentRequest({
- lnd,
- request: hash,
- max_fee: Math.min(10000, account.balance)
- });
-
- if (!m) throw new Error(`lightning payment failed ${amount} ${hash}`);
- if (m.payment_error) throw new Error(m.payment_error);
- ({ fee, secret, tokens } = m);
- preimage = secret.toString("hex");
- } else {
- let { msatoshi, msatoshi_sent, payment_preimage } = await ln.pay(
- hash,
- tokens ? `${tokens}sats` : undefined
- );
- preimage = payment_preimage;
- fee = parseInt((msatoshi_sent - msatoshi) / 1000);
- }
+ let { msatoshi, msatoshi_sent, payment_preimage } = await ln.pay(
+ hash,
+ tokens ? `${tokens}sats` : undefined
+ );
+ preimage = payment_preimage;
+ fee = parseInt((msatoshi_sent - msatoshi) / 1000);
if (store.seen.includes(preimage)) {
warn("duplicate payment detected", preimage);