Я застрял, пытаясь получить асинхронное значение в if / else, я исправил ряд ошибок, но следующее возвращает пустые скобки:
router.post('/api/shill', async (req, res) => {
let checkIdLength = req.body.Id;
let checkIP = validateIP(req.body.Ip);
let checkPort = Number.isInteger(req.body.Port);
console.log(req.body.Id);
if (checkIdLength.length != 66 || checkIP != true || checkPort != true || typeof req.body.Wumbo != "boolean") {
res.status(400).send('Invalid value(s) detected');
}
else try {
challengeInvoice = getInvoice();
res.status(200).send(challengeInvoice);
} catch (e) {console.log(e)}
})
async function getInvoice() {
await lnd.addInvoice({}, (err, res) => {return res});
}
fwiw, lnd.addInvoice
привязано к вызову grpc