diff options
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 }); |
