mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 12:37:08 +11:00
🐛 -1 fix
This commit is contained in:
parent
9ec6a5de56
commit
a898d6bb02
1 changed files with 25 additions and 23 deletions
|
|
@ -160,31 +160,33 @@ public:
|
||||||
Json::Value GetLogs(const std::string &name, const std::string &attempt)
|
Json::Value GetLogs(const std::string &name, const std::string &attempt)
|
||||||
{
|
{
|
||||||
Json::Value res;
|
Json::Value res;
|
||||||
users.if_contains(name, [&res, &attempt](const User &u) {
|
if (!users.if_contains(name, [&res, &attempt](const User &u) {
|
||||||
if (u.password != XXH3_64bits(attempt.data(), attempt.size()))
|
if (u.password != XXH3_64bits(attempt.data(), attempt.size()))
|
||||||
{
|
|
||||||
res = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (u.log.data.size())
|
|
||||||
{
|
|
||||||
uint32_t j;
|
|
||||||
for (uint32_t i = u.log.data.size() - 1; i > 0; --i)
|
|
||||||
{
|
{
|
||||||
j = u.log.data.size() - 1 - i;
|
res = 0;
|
||||||
if (!u.log.data[i].amount)
|
return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
res[j]["to"] = u.log.data[i].to;
|
|
||||||
res[j]["from"] = u.log.data[i].from;
|
|
||||||
res[j]["amount"] = u.log.data[i].amount;
|
|
||||||
res[j]["time"] = (Json::UInt64)u.log.data[i].time;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
res = -1;
|
if (u.log.data.size())
|
||||||
});
|
{
|
||||||
|
uint32_t j;
|
||||||
|
for (uint32_t i = u.log.data.size() - 1; i > 0; --i)
|
||||||
|
{
|
||||||
|
j = u.log.data.size() - 1 - i;
|
||||||
|
if (!u.log.data[i].amount)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
res[j]["to"] = u.log.data[i].to;
|
||||||
|
res[j]["from"] = u.log.data[i].from;
|
||||||
|
res[j]["amount"] = u.log.data[i].amount;
|
||||||
|
res[j]["time"] = (Json::UInt64)u.log.data[i].time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue