try not globally storing lnd and create fresh on include

This commit is contained in:
keyan 2021-06-09 16:29:15 -05:00
parent 10b2c85db1
commit 876ac52a95
1 changed files with 6 additions and 9 deletions

View File

@ -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