vote.is_final() helper
This commit is contained in:
parent
f67ca0d40c
commit
41c83a77e1
2 changed files with 6 additions and 0 deletions
|
|
@ -137,6 +137,11 @@ std::chrono::milliseconds nano::vote::duration () const
|
|||
return std::chrono::milliseconds{ 1u << (duration_bits () + 4) };
|
||||
}
|
||||
|
||||
bool nano::vote::is_final () const
|
||||
{
|
||||
return is_final_timestamp (timestamp_m);
|
||||
}
|
||||
|
||||
void nano::vote::serialize_json (boost::property_tree::ptree & tree) const
|
||||
{
|
||||
tree.put ("account", account.to_account ());
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public:
|
|||
uint64_t timestamp () const;
|
||||
uint8_t duration_bits () const;
|
||||
std::chrono::milliseconds duration () const;
|
||||
bool is_final () const;
|
||||
|
||||
static uint64_t constexpr timestamp_mask = { 0xffff'ffff'ffff'fff0ULL };
|
||||
static nano::seconds_t constexpr timestamp_max = { 0xffff'ffff'ffff'fff0ULL };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue