From 189ae0c38b7d4927c5c73b94664e9542b2b06ed9 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Fri, 29 May 2020 18:52:59 +0200 Subject: util: dedup code in callers of serviceFlagToStr() Introduce `serviceFlagsToStr()` which hides the internals of the bitmask and simplifies callers of `serviceFlagToStr()`. --- src/protocol.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index 4fb4594fbb..b720a6ce91 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -289,11 +289,11 @@ enum ServiceFlags : uint64_t { }; /** - * Convert a service flag (NODE_*) to a human readable string. + * Convert service flags (a bitmask of NODE_*) to human readable strings. * It supports unknown service flags which will be returned as "UNKNOWN[...]". - * @param[in] bit the service flag is calculated as (1 << bit) + * @param[in] flags multiple NODE_* bitwise-OR-ed together */ -std::string serviceFlagToStr(size_t bit); +std::vector serviceFlagsToStr(uint64_t flags); /** * Gets the set of service flags which are "desirable" for a given peer. -- cgit v1.2.3