mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
🐛 further bug fixes
This commit is contained in:
parent
7cef01e650
commit
a1988d3bd5
2 changed files with 6 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
.vscode
|
.vscode
|
||||||
build
|
build
|
||||||
config.json
|
config.json
|
||||||
|
users.json
|
||||||
|
|
@ -10,6 +10,10 @@ struct Log
|
||||||
uint32_t end = 0;
|
uint32_t end = 0;
|
||||||
void AddTrans(Transaction &&v)
|
void AddTrans(Transaction &&v)
|
||||||
{
|
{
|
||||||
|
if(data.size())
|
||||||
|
{
|
||||||
|
end += (end + 1 < max_log_size); //branchless
|
||||||
|
}
|
||||||
if (data.size() <= end + 1 && end + 1 < max_log_size) //if memory reserved is full
|
if (data.size() <= end + 1 && end + 1 < max_log_size) //if memory reserved is full
|
||||||
{
|
{
|
||||||
if (data.size() + pre_log_size > max_log_size)
|
if (data.size() + pre_log_size > max_log_size)
|
||||||
|
|
@ -26,7 +30,6 @@ struct Log
|
||||||
data[i] = std::move(data[i - 1]);
|
data[i] = std::move(data[i - 1]);
|
||||||
}
|
}
|
||||||
data[0] = std::move(v);
|
data[0] = std::move(v);
|
||||||
end += (end + 1 < max_log_size); //branchless
|
|
||||||
}
|
}
|
||||||
Json::Value Serialize() const
|
Json::Value Serialize() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue