aboutsummaryrefslogtreecommitdiffstats
path: root/lib/send.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-01-08 21:05:34 -0800
committerAdam Soltys <[email protected]>2023-01-08 21:05:34 -0800
commitdce07aa93b3c2f47aca0c24cea6adde9ec37f1a7 (patch)
tree6c6b8930ebe9c2cc5b8d1f759e61260f509fdd7a /lib/send.js
parentf7b844883506a8072213245b9b8a2b988694e4f5 (diff)
downloadcoinos-server-dce07aa93b3c2f47aca0c24cea6adde9ec37f1a7.tar.gz
coinos-server-dce07aa93b3c2f47aca0c24cea6adde9ec37f1a7.zip
tech debt jubilee
Diffstat (limited to 'lib/send.js')
-rw-r--r--lib/send.js16
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/send.js b/lib/send.js
index eefea080..f378cfc1 100644
--- a/lib/send.js
+++ b/lib/send.js
@@ -1,9 +1,6 @@
import config from "$config";
-import db from "$db";
import { emit } from "$lib/sockets";
import store from "./store";
-import bolt11 from "bolt11";
-import { Op } from "@sequelize/core";
import {
computeConversionFee,
conversionFeeReceiver
@@ -14,18 +11,7 @@ import { l, warn, err } from "$lib/logging";
export default async (amount, memo, hash, user) => {
l("attempting lightning payment", user.username, amount, hash);
- let payreq = bolt11.decode(hash);
- let routingInfo = payreq.tags.find(t => t.tagName === "routing_info");
- if (
- routingInfo &&
- routingInfo.data.find(d => d.fee_proportional_millionths > 10000)
- ) {
- warn("fee rate too high", routingInfo);
- throw new Error(
- "Couldn't find a suitable route to pay to your destination"
- );
- }
-
+ // decode payreq with cl
if (!amount || payreq.satoshis > amount) amount = payreq.satoshis;
amount = parseInt(amount);