mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 20:47:10 +11:00
🐛 fixing last commit
This commit is contained in:
parent
d63be0ec73
commit
5e253e42d9
1 changed files with 12 additions and 2 deletions
14
src/bank.cpp
14
src/bank.cpp
|
|
@ -232,16 +232,26 @@ BankResponse Bank::PruneUsers(uint32_t threshold_bal) noexcept
|
|||
#endif
|
||||
for (const auto &u : users)
|
||||
{
|
||||
|
||||
#if MAX_LOG_SIZE > 0
|
||||
|
||||
#if RETURN_ON_DEL
|
||||
if (Bank::users.erase_if(u.first, [threshold_bal, &bal, &deleted_count](User &u) {
|
||||
if (Bank::users.erase_if(u.first, [threshold_time, 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) {
|
||||
#endif
|
||||
#if MAX_LOG_SIZE > 0
|
||||
return ((!u.log.data.size() || u.log.data.back().time < threshold_time) && u.balance < threshold_bal);
|
||||
#else
|
||||
|
||||
#if RETURN_ON_DEL
|
||||
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_bal, &deleted_count](User &u) {
|
||||
#endif
|
||||
return (u.balance < threshold_bal);
|
||||
|
||||
#endif
|
||||
}))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue