adding frontier_req to_string() (#3986)

* adding frontier_req::to_string()

Co-authored-by: Dimitrios Siganos <dimitris@siganos.org>
This commit is contained in:
Ian Cunningham 2023-01-08 17:19:05 -06:00 committed by GitHub
commit ee0ff54db1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -1065,6 +1065,15 @@ bool nano::frontier_req::operator== (nano::frontier_req const & other_a) const
return start == other_a.start && age == other_a.age && count == other_a.count; return start == other_a.start && age == other_a.age && count == other_a.count;
} }
std::string nano::frontier_req::to_string () const
{
std::string s = header.to_string ();
s += "\nstart=" + start.to_string ();
s += " maxage=" + std::to_string (age);
s += " count=" + std::to_string (count);
return s;
}
/* /*
* bulk_pull * bulk_pull
*/ */

View file

@ -227,6 +227,7 @@ public:
uint32_t age; uint32_t age;
uint32_t count; uint32_t count;
static std::size_t constexpr size = sizeof (start) + sizeof (age) + sizeof (count); static std::size_t constexpr size = sizeof (start) + sizeof (age) + sizeof (count);
std::string to_string () const;
}; };
enum class telemetry_maker : uint8_t enum class telemetry_maker : uint8_t