From ee0ff54db19a3a919ce91a88df8394a314ed7a38 Mon Sep 17 00:00:00 2001 From: Ian Cunningham Date: Sun, 8 Jan 2023 17:19:05 -0600 Subject: [PATCH] adding frontier_req to_string() (#3986) * adding frontier_req::to_string() Co-authored-by: Dimitrios Siganos --- nano/node/messages.cpp | 9 +++++++++ nano/node/messages.hpp | 1 + 2 files changed, 10 insertions(+) diff --git a/nano/node/messages.cpp b/nano/node/messages.cpp index dc74086f9..4a501c35c 100644 --- a/nano/node/messages.cpp +++ b/nano/node/messages.cpp @@ -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; } +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 */ diff --git a/nano/node/messages.hpp b/nano/node/messages.hpp index 6c60285b8..f4f9927cc 100644 --- a/nano/node/messages.hpp +++ b/nano/node/messages.hpp @@ -227,6 +227,7 @@ public: uint32_t age; uint32_t count; static std::size_t constexpr size = sizeof (start) + sizeof (age) + sizeof (count); + std::string to_string () const; }; enum class telemetry_maker : uint8_t