From 876ac52a9506fa5cdf2270f835de7c5d26cd3f6c Mon Sep 17 00:00:00 2001 From: keyan Date: Wed, 9 Jun 2021 16:29:15 -0500 Subject: [PATCH] try not globally storing lnd and create fresh on include --- api/lnd/index.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/api/lnd/index.js b/api/lnd/index.js index ff14c93a..1a3216b8 100644 --- a/api/lnd/index.js +++ b/api/lnd/index.js @@ -1,12 +1,9 @@ import lndService from 'ln-service' -if (!global.lnd) { - const { lnd } = lndService.authenticatedLndGrpc({ - cert: process.env.LND_CERT, - macaroon: process.env.LND_MACAROON, - socket: process.env.LND_SOCKET - }) - global.lnd = lnd -} +const { lnd } = lndService.authenticatedLndGrpc({ + cert: process.env.LND_CERT, + macaroon: process.env.LND_MACAROON, + socket: process.env.LND_SOCKET +}) -export default global.lnd +export default lnd