diff --git a/src/withdrawMoney.c b/src/withdrawMoney.c index 65e23b2..cfea08b 100644 --- a/src/withdrawMoney.c +++ b/src/withdrawMoney.c @@ -81,23 +81,22 @@ bool withdraw(int user_id) { bool withdrawSpecificAmount(int user_id, float amountToWithdraw) { float remainingAccountBalance; - float availableAccountBalance = getAvailableAccountBalance(user_id); - if (amountToWithdraw > 0) { + if (amountToWithdraw > 0) { if (amountToWithdraw <= availableAccountBalance) { - remainingAccountBalance = initiateWithdraw(amountToWithdraw, availableAccountBalance); - if(updateAvailableAccountBalance(user_id, remainingAccountBalance)){ + if (updateAvailableAccountBalance(user_id, remainingAccountBalance)) { return true; } - - } } + } + return false; } + // int main(){ // withdraw(1234); // return 1; -// } \ No newline at end of file +// }