diff options
| author | Adrien Hopkins <[email protected]> | 2022-06-13 09:50:50 -0500 |
|---|---|---|
| committer | Adrien Hopkins <[email protected]> | 2022-06-13 09:50:50 -0500 |
| commit | 1c02aa63933a234faa45eecbfdc82dae7f6e174c (patch) | |
| tree | abddf5963cea6519b30e72fe990f262f3577dfd4 | |
| parent | 2498ed9a93405c999c9336e0cb18a187716c1d03 (diff) | |
| download | coinos-server-1c02aa63933a234faa45eecbfdc82dae7f6e174c.tar.gz coinos-server-1c02aa63933a234faa45eecbfdc82dae7f6e174c.zip | |
Ensure a whole number of fee credits is given in transactions
| -rw-r--r-- | routes/bitcoin/receive.js | 2 | ||||
| -rw-r--r-- | routes/liquid/receive.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js index 5025a809..5bdbcb72 100644 --- a/routes/bitcoin/receive.js +++ b/routes/bitcoin/receive.js @@ -195,7 +195,7 @@ setInterval(async () => { { pending: Math.min(account.pending, total) }, { transaction } ); - await account.increment({ fee_credits: total * withdrawalFeeMultiplier }, { transaction }); + await account.increment({ fee_credits: Math.floor(total * withdrawalFeeMultiplier) }, { transaction }); await account.reload({ transaction }); await p.save({ transaction }); diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index 6d4c128b..88166c91 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -343,7 +343,7 @@ setInterval(async () => { { pending: Math.min(p.account.pending, total) }, { transaction } ); - await account.increment({ fee_credits: total * withdrawalFeeMultiplier }, { transaction }); + await account.increment({ fee_credits: Math.floor(total * withdrawalFeeMultiplier) }, { transaction }); await p.account.reload({ transaction }); await p.save({ transaction }); |
