From 44aa9acc25134f69ebc1de29c5fb8d71b5e6c7db Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Sun, 22 Oct 2023 18:57:44 -0400 Subject: [PATCH] LNC: PayLightningInvoice: temporarily disable forced timeout --- backends/LightningNodeConnect.ts | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/backends/LightningNodeConnect.ts b/backends/LightningNodeConnect.ts index 53687f743..303ed7ab6 100644 --- a/backends/LightningNodeConnect.ts +++ b/backends/LightningNodeConnect.ts @@ -7,7 +7,6 @@ import OpenChannelRequest from '../models/OpenChannelRequest'; import Base64Utils from '../utils/Base64Utils'; import { snakeize } from '../utils/DataFormatUtils'; -import { localeString } from '../utils/LocaleUtils'; import VersionUtils from '../utils/VersionUtils'; import { Hash as sha256Hash } from 'fast-sha256'; @@ -192,30 +191,12 @@ export default class LightningNodeConnect { await this.lnc.lnd.lightning .decodePayReq({ pay_req: urlParams && urlParams[0] }) .then((data: lnrpc.PayReq) => snakeize(data)); - payLightningInvoice = async (data: any) => { + payLightningInvoice = (data: any) => { if (data.pubkey) delete data.pubkey; - - const forcedTimeout = async (time_ms: number, response: any) => { - await new Promise((res) => setTimeout(res, time_ms)); - return response; - }; - - const call = () => - this.lnc.lnd.router.sendPaymentV2({ - ...data, - allow_self_payment: true - }); - - const result: any = await Promise.race([ - forcedTimeout((data.timeout_seconds + 1) * 1000, { - payment_error: localeString( - 'views.SendingLightning.paymentTimedOut' - ) - }), - call() - ]); - - return result; + return this.lnc.lnd.router.sendPaymentV2({ + ...data, + allow_self_payment: true + }); }; closeChannel = async (urlParams?: Array) => { let params;