From d63be0ec732daed79fa01dfd3606a635f37b5128 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Sun, 18 Dec 2022 17:18:47 -0800 Subject: [PATCH] :bug: logs being disabled wasnt building --- src/bank.cpp | 4 +++- src/bank_api.cpp | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bank.cpp b/src/bank.cpp index a6cbefe..08ba3a1 100644 --- a/src/bank.cpp +++ b/src/bank.cpp @@ -86,6 +86,7 @@ BankResponse Bank::GetBal(const std::string &name) noexcept } } #if MAX_LOG_SIZE > 0 + #if MIN_API_SUPPORT == 1 BankResponse Bank::GetLogs(const std::string &name) noexcept { @@ -115,6 +116,7 @@ BankResponse Bank::GetLogsV2(const std::string &name) noexcept } } #endif + #endif BankResponse Bank::SendFunds(const std::string &a_name, const std::string &b_name, uint32_t amount) noexcept @@ -231,7 +233,7 @@ BankResponse Bank::PruneUsers(uint32_t threshold_bal) noexcept for (const auto &u : users) { #if RETURN_ON_DEL - if (Bank::users.erase_if(u.first, [threshold_time, threshold_bal, &bal, &deleted_count](User &u) { + if (Bank::users.erase_if(u.first, [threshold_bal, &bal, &deleted_count](User &u) { bal += u.balance; #else if (Bank::users.erase_if(u.first, [threshold_time, threshold_bal, &deleted_count](User &u) { diff --git a/src/bank_api.cpp b/src/bank_api.cpp index 7b2a15e..aaef815 100644 --- a/src/bank_api.cpp +++ b/src/bank_api.cpp @@ -244,9 +244,9 @@ void api::PruneUsers(req_args) } else { + uint64_t amount; #if MAX_LOG_SIZE > 0 int64_t time; - uint64_t amount; if (doc["time"].get(time) || doc["amount"].get(amount) || (amount > std::numeric_limits::max())) { res = BankResponse{k400BadRequest, "\"Missing/Invalid JSON arg(s)\""}; @@ -256,7 +256,6 @@ void api::PruneUsers(req_args) res = Bank::PruneUsers(time, amount); } #else - uint64_t amount if (doc["amount"].get(amount) || (amount > std::numeric_limits::max())) { res = BankResponse{k400BadRequest, "\"Missing/Invalid JSON arg(s)\""};