diff options
| -rw-r--r-- | index.js | 1 | ||||
| -rw-r--r-- | routes/liquid/send.js | 13 |
2 files changed, 7 insertions, 7 deletions
@@ -96,7 +96,6 @@ app.use((err, req, res, next) => { "Cache-Control": "no-cache" }); res.send(err.message); - return res.end(); }); server.listen(config.port, () => diff --git a/routes/liquid/send.js b/routes/liquid/send.js index a3bb7639..0729370c 100644 --- a/routes/liquid/send.js +++ b/routes/liquid/send.js @@ -67,7 +67,8 @@ sendLiquid = async ({ user, address, memo, tx, limit }) => { } } - if (limit && total > limit) throw new Error("Tx amount exceeds authorized amount"); + if (limit && total > limit) + throw new Error("Tx amount exceeds authorized amount"); if (asset !== btc || total) { l.info("creating liquid payment", user.username, asset, total, fee); @@ -147,13 +148,13 @@ sendLiquid = async ({ user, address, memo, tx, limit }) => { module.exports = ah(async (req, res) => { let { user } = req; - let { address, feeRate, memo, tx } = req.body; - - if (!tx) { - ({ tx } = await liquidTx({ ...req.body, user })); - } try { + let { address, feeRate, memo, tx } = req.body; + + if (!tx) { + ({ tx } = await liquidTx({ ...req.body, user })); + } res.send(await sendLiquid({ user, address, memo, tx })); } catch (e) { l.error("problem sending liquid", user.username, e.message); |
