diff options
| author | Adam Soltys <[email protected]> | 2021-03-19 14:37:20 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-03-19 14:37:22 -0700 |
| commit | 70c8455d9920755b1b925046d46c486a313944c9 (patch) | |
| tree | 4abd9282fcbe9dda76b8e88682262209b5269850 /routes/liquid/send.js | |
| parent | b4606c0604eada8cdbd372c33f5faa39912b88d9 (diff) | |
| download | coinos-server-70c8455d9920755b1b925046d46c486a313944c9.tar.gz coinos-server-70c8455d9920755b1b925046d46c486a313944c9.zip | |
check conversion limit
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); |
