diff options
| author | Luke Dashjr <[email protected]> | 2020-02-17 01:53:13 +0000 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2020-02-21 19:10:04 +0000 |
| commit | c31bc5bcfddf440e9a1713f7ba2ca2bf9cfa8e2e (patch) | |
| tree | 7d04a6ac6765a3591963d9420d68d2c64620cbd3 /src/protocol.h | |
| parent | Bugfix: GUI: Use unsigned long long type to avoid implicit conversion of MSB ... (diff) | |
| download | discoin-c31bc5bcfddf440e9a1713f7ba2ca2bf9cfa8e2e.tar.xz discoin-c31bc5bcfddf440e9a1713f7ba2ca2bf9cfa8e2e.zip | |
Consolidate service flag bit-to-name conversion to a shared serviceFlagToStr function
Side effect: this results in the RPC showing unknown service bits as "UNKNOWN[n]" like the GUI.
Note that there is no common mask-to-vector<string> function because both GUI and RPC would need to iterate through it to convert to their desired target formats.
Diffstat (limited to 'src/protocol.h')
| -rw-r--r-- | src/protocol.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/protocol.h b/src/protocol.h index db07efb9f..2d29c2fee 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -237,7 +237,7 @@ const std::vector<std::string> &getAllNetMessageTypes(); /** nServices flags */ enum ServiceFlags : uint64_t { - // NOTE: When adding here, be sure to update qt/guiutil.cpp's formatServicesStr too + // NOTE: When adding here, be sure to update serviceFlagToStr too // Nothing NODE_NONE = 0, // NODE_NETWORK means that the node is capable of serving the complete block chain. It is currently @@ -268,6 +268,8 @@ enum ServiceFlags : uint64_t { // BIP process. }; +std::string serviceFlagToStr(uint64_t mask, int bit); + /** * Gets the set of service flags which are "desirable" for a given peer. * |