avoid dev refresh of lnd

This commit is contained in:
k00b 2024-10-16 11:25:04 -05:00
parent ec8e775ae6
commit 1645c2aabf
1 changed files with 4 additions and 2 deletions

View File

@ -2,11 +2,13 @@ import { cachedFetcher } from '@/lib/fetch'
import { toPositiveNumber } from '@/lib/validate'
import { authenticatedLndGrpc, getIdentity, getHeight, getWalletInfo, getNode } from 'ln-service'
const { lnd } = authenticatedLndGrpc({
const lnd = global.lnd || authenticatedLndGrpc({
cert: process.env.LND_CERT,
macaroon: process.env.LND_MACAROON,
socket: process.env.LND_SOCKET
})
}).lnd
if (process.env.NODE_ENV === 'development') global.lnd = lnd
// Check LND GRPC connection
getWalletInfo({ lnd }, (err, result) => {