Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
({decodeFundingRequest, findRouteForFunding}, cbk) =>
{
if (!!args.recovery) {
return cbk();
}
args.logger.info({funding_swap: decodeFundingRequest.id});
return payViaRoutes({
id: decodeFundingRequest.id,
lnd: args.lnd,
routes: [findRouteForFunding],
},
cbk);
}],
pay: ['probe', 'to', ({probe, to}, cbk) => {
if (!args.is_real_payment) {
return cbk();
}
if (!probe.route) {
return cbk();
}
if (args.max_fee !== undefined && probe.route.fee > args.max_fee) {
return cbk([400, 'MaxFeeTooLow', {required_fee: probe.route.fee}]);
}
args.logger.info({paying: probe.route.hops.map(({channel}) => channel)});
return payViaRoutes({
id: to.id,
lnd: args.lnd,
routes: [probe.route],
},
cbk);
}],
({getRoute, lnd, parsedInvoice}, cbk) =>
{
return payViaRoutes({
lnd,
id: parsedInvoice.id,
routes: [getRoute.route],
},
cbk);
}],
pay: ['invoice', 'lnd', 'routes', ({invoice, lnd, routes}, cbk) => {
return payViaRoutes({lnd, routes, id: invoice.id}, cbk);
}],