diff options
Diffstat (limited to 'routes/liquid')
| -rw-r--r-- | routes/liquid/fee.js | 2 | ||||
| -rw-r--r-- | routes/liquid/send.js | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/routes/liquid/fee.js b/routes/liquid/fee.js index 82bb7604..1f5c1deb 100644 --- a/routes/liquid/fee.js +++ b/routes/liquid/fee.js @@ -74,7 +74,7 @@ module.exports = ah(async (req, res) => { try { res.send(await liquidTx({ ...req.body, user: req.user })); } catch (e) { - l.error("error estimating liquid fee", e.message); + l.error("error estimating liquid fee", e.message, e.stack); return res.status(500).send(e.message); } }); diff --git a/routes/liquid/send.js b/routes/liquid/send.js index ee62c1b8..ab28471e 100644 --- a/routes/liquid/send.js +++ b/routes/liquid/send.js @@ -1,7 +1,7 @@ const btc = config.liquid.btcasset; const lcad = config.liquid.cadasset; -sendLiquid = async ({ user, address, memo, tx }) => { +sendLiquid = async ({ user, address, memo, tx, limit }) => { const isChange = async address => (await lq.getAddressInfo(address)).ismine && !Object.keys(addresses).includes(address); @@ -67,6 +67,8 @@ sendLiquid = async ({ user, address, memo, tx }) => { } } + 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); |
