mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-18 17:12:14 +11:00
New time constructor
This commit is contained in:
parent
239573e246
commit
dc11416d9a
1 changed files with 6 additions and 1 deletions
|
|
@ -11,6 +11,11 @@ struct Transaction
|
||||||
uint64_t time = 0;
|
uint64_t time = 0;
|
||||||
|
|
||||||
Transaction() = default;
|
Transaction() = default;
|
||||||
|
Transaction(std::string from_str, std::string to_str, uint32_t amount uint64_t time) : amount(amount), time(time)
|
||||||
|
{
|
||||||
|
from = std::move(from_str);
|
||||||
|
to = std::move(to_str);
|
||||||
|
}
|
||||||
Transaction(std::string from_str, std::string to_str, uint32_t amount) : amount(amount)
|
Transaction(std::string from_str, std::string to_str, uint32_t amount) : amount(amount)
|
||||||
{
|
{
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
@ -18,4 +23,4 @@ struct Transaction
|
||||||
to = std::move(to_str);
|
to = std::move(to_str);
|
||||||
time = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
|
time = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue