diff --git a/src/protocol.h b/src/protocol.h --- a/src/protocol.h +++ b/src/protocol.h @@ -309,6 +309,9 @@ // See BIP159 for details on how this is implemented. NODE_NETWORK_LIMITED = (1 << 10), + // The last non experimental service bit, helper for looping over the flags + NODE_LAST_SERVICE_BIT = NODE_NETWORK_LIMITED, + // Bits 24-31 are reserved for temporary experiments. Just pick a bit that // isn't getting used, or one not being used much, and notify the // bitcoin-development mailing list. Remember that service bits are just diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -887,9 +887,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: