aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2020-05-29 18:49:26 +0200
committerVasil Dimov <vd@FreeBSD.org>2020-05-29 18:49:26 +0200
commitfbacad1880341ace31f669530c66d4e322d19235 (patch)
tree39b4b49f13a0899c3232dd6885980f866afa611f /src/protocol.h
parentf2e2c5ebcccf8d656b850c28452e6e652934f36b (diff)
downloadbitcoin-fbacad1880341ace31f669530c66d4e322d19235.tar.xz
util: simplify the interface of serviceFlagToStr()
Don't take two redundant arguments in `serviceFlagToStr()`. As a side effect this fixes an issue introduced in https://github.com/bitcoin/bitcoin/pull/18165 due to which the GUI could print something like `UNKNOWN[1033] & UNKNOWN[1033] & UNKNOWN[2^10]` instead of `NETWORK & WITNESS`.
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/protocol.h b/src/protocol.h
index c12bec9bf3..4fb4594fbb 100644
--- a/src/protocol.h
+++ b/src/protocol.h
@@ -288,7 +288,12 @@ enum ServiceFlags : uint64_t {
// BIP process.
};
-std::string serviceFlagToStr(uint64_t mask, int bit);
+/**
+ * Convert a service flag (NODE_*) to a human readable string.
+ * It supports unknown service flags which will be returned as "UNKNOWN[...]".
+ * @param[in] bit the service flag is calculated as (1 << bit)
+ */
+std::string serviceFlagToStr(size_t bit);
/**
* Gets the set of service flags which are "desirable" for a given peer.