diff options
Diffstat (limited to 'routes/liquid/send.js')
| -rw-r--r-- | routes/liquid/send.js | 4 |
1 files changed, 3 insertions, 1 deletions
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); |
