diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -83,6 +83,14 @@ namespace GUIUtil { +/** + * Highest service flag bit to consider for display in pee details view. + * Correspondig bits are whether translated to some human readable text + * (e.g. NODE_NETWORK is displayed as "NETWORK") or as "UNKNOWN" with the bit + * position. + */ +static const uint64_t NODE_LAST_SERVICE_BIT = NODE_NETWORK_LIMITED; + QString dateTimeStr(const QDateTime &date) { return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm"); @@ -887,9 +895,8 @@ QString formatServicesStr(quint64 mask) { QStringList strList; - // Just scan the last 11 bits for now. - for (int i = 0; i < 11; i++) { - uint64_t check = 1 << i; + // Just scan up to NODE_LAST_SERVICE_BIT for now. + for (uint64_t check = 1; check <= NODE_LAST_SERVICE_BIT; check <<= 1) { if (mask & check) { switch (check) { case NODE_NETWORK: