Skip to content

Commit

Permalink
pay invoice logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanfeenstra committed May 24, 2020
1 parent fee5f79 commit cc9e0db
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions api/controllers/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ const payInvoice = async (req, res) => {
const lightning = await loadLightning()
const { payment_request } = req.body;

if(!payment_request){
console.log('[pay invoice] "payment_request" is empty')
res.status(400)
res.json({success:false, error:'payment_request is empty'})
res.end()
return
}
console.log(`[pay invoice] ${payment_request}`)

var call = lightning.sendPayment({})

call.on('data', async response => {
Expand Down
8 changes: 8 additions & 0 deletions dist/api/controllers/invoices.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/api/controllers/invoices.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cc9e0db

Please sign in to comment.