use new getChanInfo()

This commit is contained in:
Daniel Lugo 2021-01-10 10:33:43 -04:00
parent 4a3a802a2a
commit c5e48b1eb5

View file

@ -1020,30 +1020,15 @@ module.exports = async (
) )
}) })
// get lnd chan info // get lnd chan info
app.post('/api/lnd/getchaninfo', (req, res) => { app.post('/api/lnd/getchaninfo', async (req, res) => {
const { lightning } = LightningServices.services try {
return res.json(await LV2.getChanInfo(req.body.chan_id))
lightning.getChanInfo( } catch (e) {
{ chan_id: req.body.chan_id }, console.log(e)
async (err, response) => { return res.status(500).json({
if (err) { errorMessage: e.message
logger.debug('GetChanInfo Error:', err)
const health = await checkHealth()
if (health.LNDStatus.success) {
res.status(400)
res.json({
field: 'getChanInfo',
errorMessage: sanitizeLNDError(err.message)
}) })
} else {
res.status(500)
res.json({ errorMessage: 'LND is down' })
} }
}
logger.debug('GetChanInfo:', response)
res.json(response)
}
)
}) })
app.get('/api/lnd/getnetworkinfo', (req, res) => { app.get('/api/lnd/getnetworkinfo', (req, res) => {