diff options
| author | Adrien Hopkins <[email protected]> | 2022-06-13 16:16:37 -0500 |
|---|---|---|
| committer | Adrien Hopkins <[email protected]> | 2022-06-13 16:16:37 -0500 |
| commit | f37c8ba68418a2a325f45a7a36c139cb5bc696aa (patch) | |
| tree | 98759089e8015931030877fb064507150ade7c36 /routes/liquid/receive.js | |
| parent | 9527f8a68f6a0a329c82dd8350703d10070437d5 (diff) | |
| parent | 1c02aa63933a234faa45eecbfdc82dae7f6e174c (diff) | |
| download | coinos-server-f37c8ba68418a2a325f45a7a36c139cb5bc696aa.tar.gz coinos-server-f37c8ba68418a2a325f45a7a36c139cb5bc696aa.zip | |
Merge branch 'feature-withdrawal-fee'
Diffstat (limited to 'routes/liquid/receive.js')
| -rw-r--r-- | routes/liquid/receive.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index d2864872..0eed35fd 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -13,6 +13,9 @@ const network = config.liquid.network === "mainnet" ? "liquid" : config.liquid.network ]; +// used to calculate how many credits to give +const withdrawalFeeMultiplier = 0.01; + const getAccount = async (params, transaction) => { let account = await db.Account.findOne({ where: params, @@ -341,6 +344,7 @@ setInterval(async () => { { pending: Math.min(p.account.pending, total) }, { transaction } ); + await account.increment({ fee_credits: Math.floor(total * withdrawalFeeMultiplier) }, { transaction }); await p.account.reload({ transaction }); await p.save({ transaction }); |
