🔥 removed recieving

This commit is contained in:
EntireTwix 2021-04-21 19:09:29 -07:00
parent fb3000820f
commit 3b36ec90cc
2 changed files with 2 additions and 4 deletions

View file

@ -180,7 +180,6 @@ 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;
bool state = false; bool state = false;
users.if_contains(name, [&state, &attempt](const User &u) { users.if_contains(name, [&state, &attempt](const User &u) {
state = XXH3_64bits(attempt.data(), attempt.size()) == u.password; state = XXH3_64bits(attempt.data(), attempt.size()) == u.password;
@ -188,6 +187,7 @@ public:
if (state) if (state)
{ {
Json::Value res;
logs.if_contains(name, [&res](const Log &l) { logs.if_contains(name, [&res](const Log &l) {
for (uint32_t i = l.data.size() - 1; i >= 0; --i) for (uint32_t i = l.data.size() - 1; i >= 0; --i)
{ {
@ -198,7 +198,6 @@ public:
res[99 - i]["to"] = l.data[i].to; res[99 - i]["to"] = l.data[i].to;
res[99 - i]["from"] = l.data[i].from; res[99 - i]["from"] = l.data[i].from;
res[99 - i]["amount"] = l.data[i].amount; res[99 - i]["amount"] = l.data[i].amount;
res[99 - i]["recieving"] = l.data[i].recieving;
} }
}); });
return res; return res;

View file

@ -5,7 +5,6 @@ struct Transaction
{ {
std::string from = "", to = ""; std::string from = "", to = "";
uint32_t amount = 0; uint32_t amount = 0;
bool recieving = false;
void Concatinate(std::string &s) void Concatinate(std::string &s)
{ {
@ -19,7 +18,7 @@ struct Transaction
} }
Transaction() = default; Transaction() = default;
Transaction(std::string from_str, std::string to_str, uint32_t amount, bool recieving) : amount(amount), recieving(recieving) Transaction(std::string from_str, std::string to_str, uint32_t amount) : amount(amount)
{ {
Concatinate(from_str); Concatinate(from_str);
Concatinate(to_str); Concatinate(to_str);