mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 12:37:08 +11:00
fixed logic
This commit is contained in:
parent
c6c08832e7
commit
e6988b8abc
1 changed files with 6 additions and 5 deletions
|
|
@ -36,16 +36,17 @@ struct User
|
|||
{
|
||||
if (log_j.size())
|
||||
{
|
||||
auto size = ((log_j.size() / pre_log_size) + 1) * pre_log_size; // Ensures that we have a log size aligned on a multiple of `pre_log_size`
|
||||
log.data.reserve(std::min(size, max_log_size)); // Ensures that the log size is under `max_log_size`
|
||||
for (uint32_t i = 0; i < log.size(); i++) // Matches the logs
|
||||
unsigned size = ((log_j.size() / pre_log_size) + 1) * pre_log_size; // Ensures that we have a log size aligned on a multiple of `pre_log_size`
|
||||
log.data.reserve(size); // Ensures that the log size is under `max_log_size`
|
||||
size = std::min(log_j.size(), max_log_size);
|
||||
log.data.resize(size);
|
||||
for (uint32_t i = 0; i < size; ++i)
|
||||
{
|
||||
log.data[i] = std::move(Transaction(
|
||||
log_j[i]["from"].asCString(),
|
||||
log_j[i]["to"].asCString(),
|
||||
log_j[i]["amount"].asUInt(),
|
||||
log_j[i]["time"].asUInt64()
|
||||
));
|
||||
log_j[i]["time"].asUInt64()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue