diff options
Diffstat (limited to 'routes/send.js')
| -rw-r--r-- | routes/send.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/routes/send.js b/routes/send.js index e8fdb79c..cdaa8a9b 100644 --- a/routes/send.js +++ b/routes/send.js @@ -158,7 +158,28 @@ module.exports = ah(async (req, res, next) => { received: true, }; - if (invoice) params.invoice_id = invoice.id; + if (invoice) { + params.invoice_id = invoice.id; + + let c = convert[invoice.text]; + if (c) { + l.info( + "internal payment detected for conversion", + invoice.text, + c.address, + recipient.username + ); + + recipient.account = a2; + + sendLiquid({ + address: c.address, + amount: amount - 100, + user: recipient, + limit: amount, + }).catch(console.log); + } + } let p2 = await db.Payment.create(params, { transaction }); |
