diff --git a/README.md b/README.md index dc77bc9..4dad937 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ Go to `{ip}/BankF/help` to see the bank's methods (also found in releases as hel - **RESTful** API for connected services like a market, gambling, or anything else you can think of - able to be used millions of blocks away, across dimensions, servers, **vanilla or modded**. In contrast to an in-game modded implementation that would be range limited. +- **Logging** of all transactions, configurable in (log_consts.hpp)[include/log_consts.hpp] ## Dependencies diff --git a/include/log.hpp b/include/log.hpp index 5b30401..60cd1ac 100644 --- a/include/log.hpp +++ b/include/log.hpp @@ -1,6 +1,7 @@ #pragma once #include #include +#include "log_consts.hpp" #include "transactions.hpp" struct Log @@ -9,19 +10,16 @@ struct Log uint32_t end = 0; void AddTrans(Transaction &&v) { - if (!data.size()) + if (data.size() == end) { - data.resize(50); + data.resize(data.size()+pre_log_size); //prefetching memory } - if (end) + for (uint32_t i = end; i > 0; --i) { - for (uint32_t i = end; i > 0; --i) - { - data[i] = std::move(data[i - 1]); - } + data[i] = std::move(data[i - 1]); } data[0] = std::move(v); - if (end < 50) + if (end < max_log_size) { ++end; } diff --git a/include/user.hpp b/include/user.hpp index e1efaca..18769de 100644 --- a/include/user.hpp +++ b/include/user.hpp @@ -34,7 +34,7 @@ struct User { if(log_j.size()) { - log.data.resize(50); + log.data.resize(log_j.size()+pre_log_size); log.end = log_j.size(); for(uint32_t i = 0; i < log_j.size(); ++i) {