Merge pull request #201 from shocknet/invoices-bootstrap
Invoices bootstrap
This commit is contained in:
commit
3d965fe630
1 changed files with 44 additions and 17 deletions
|
|
@ -695,7 +695,24 @@ module.exports = async (
|
||||||
alias,
|
alias,
|
||||||
publicKey
|
publicKey
|
||||||
},
|
},
|
||||||
follows: await GunGetters.Follows.currentFollows()
|
follows: await GunGetters.Follows.currentFollows(),
|
||||||
|
data: {
|
||||||
|
invoices: await Common.makePromise((res, rej) => {
|
||||||
|
lightning.listInvoices(
|
||||||
|
{
|
||||||
|
reversed: true,
|
||||||
|
num_max_invoices: 50
|
||||||
|
},
|
||||||
|
(err, lres) => {
|
||||||
|
if (err) {
|
||||||
|
rej(new Error(err.details))
|
||||||
|
} else {
|
||||||
|
res(lres)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
@ -3069,6 +3086,7 @@ module.exports = async (
|
||||||
})
|
})
|
||||||
|
|
||||||
ap.post('/api/lnd/cb/:methodName', (req, res) => {
|
ap.post('/api/lnd/cb/:methodName', (req, res) => {
|
||||||
|
try {
|
||||||
const { lightning } = LightningServices.services
|
const { lightning } = LightningServices.services
|
||||||
const { methodName } = req.params
|
const { methodName } = req.params
|
||||||
const args = req.body
|
const args = req.body
|
||||||
|
|
@ -3086,5 +3104,14 @@ module.exports = async (
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} catch (err) {
|
||||||
|
logger.warn(`Error inside api cb:`)
|
||||||
|
logger.error(err)
|
||||||
|
logger.error(err.message)
|
||||||
|
|
||||||
|
return res.status(500).json({
|
||||||
|
errorMessage: err.message
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue