This commit is contained in:
Overtorment
2019-04-04 12:51:46 +01:00
parent 0f423817c3
commit 75bfac565c
4 changed files with 6 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ router.post('/addinvoice', postLimiter, async function(req, res) {
}
logger.log('/addinvoice', [req.id, 'userid: ' + u.getUserId()]);
if (!req.body.amt) return errorBadArguments(res);
if (!req.body.amt || req.body.amt < 1) return errorBadArguments(res);
lightning.addInvoice({ memo: req.body.memo, value: req.body.amt }, async function(err, info) {
if (err) return errorLnd(res);
@@ -179,6 +179,7 @@ router.post('/payinvoice', async function(req, res) {
value: +info.num_satoshis + Math.floor(info.num_satoshis * 0.01),
fee: Math.floor(info.num_satoshis * Paym.fee),
memo: decodeURIComponent(info.description),
pay_req: req.body.invoice,
});
await UserPayee.setPaymentHashPaid(info.payment_hash);

View File

@@ -69,6 +69,7 @@ const pubkey2name = {
'02816caed43171d3c9854e3b0ab2cf0c42be086ff1bd4005acc2a5f7db70d83774': 'ln.pizza',
'024a2e265cd66066b78a788ae615acdc84b5b0dec9efac36d7ac87513015eaf6ed': 'Bitrefill.com/lightning',
'02a0bc43557fae6af7be8e3a29fdebda819e439bea9c0f8eb8ed6a0201f3471ca9': 'LightningPeachHub',
'02d4531a2f2e6e5a9033d37d548cff4834a3898e74c3abe1985b493c42ebbd707d': 'coinfinity.co',
};
router.get('/', function(req, res) {