From 52716276db81bf8b9559cc2b361927d7be836897 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Tue, 7 Jun 2022 16:56:24 -0500 Subject: Withdrawal credits can be used to reduce the withdrawal fee --- routes/bitcoin/send.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routes/bitcoin') diff --git a/routes/bitcoin/send.js b/routes/bitcoin/send.js index efcedb38..a9c95b31 100644 --- a/routes/bitcoin/send.js +++ b/routes/bitcoin/send.js @@ -68,11 +68,11 @@ module.exports = ah(async (req, res) => { } // use user's credits to reduce fee, if available - console.log(account.fee_credits); let withdrawalFeeDeduction = Math.min(account.fee_credits, withdrawalFee); if (withdrawalFeeDeduction) { await account.decrement({ fee_credits: withdrawalFeeDeduction }, { transaction }); await account.reload({ transaction }); + withdrawalFee -= withdrawalFeeDeduction; } await account.decrement({ balance: (total + withdrawalFee) }, { transaction }); -- cgit v1.2.3