diff options
Diffstat (limited to 'lib/send.js')
| -rw-r--r-- | lib/send.js | 16 |
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); |
