Merge #19112: rpc: Remove special case for unknown service flags

fa1433ac1b rpc: Remove special case for unknown service flags (MarcoFalke)

Pull request description:

  The special case to return a bit as an integer is clumsy and undocumented. Probably also irrelevant because there shouldn't currently be a non-misbehaving client that connects to Bitcoin Core and advertises an unknown service flag.

  Thus, simply remove the code.

ACKs for top commit:
  laanwj:
    ACK fa1433ac1b

Tree-SHA512: 942de6a577a9ee076ce12c92be121617640d53ee8c3424064c45a30a7ff789555d3722a4203670768faf81da2a40adfed3ec5cdeb5da06f04be81ddb53b9db7e
This commit is contained in:
Wladimir J. van der Laan
2020-06-04 17:09:53 +02:00
2 changed files with 11 additions and 6 deletions

View File

@@ -5,8 +5,8 @@
#include <protocol.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <util/system.h>
#ifndef WIN32
# include <arpa/inet.h>
@@ -220,11 +220,7 @@ static std::string serviceFlagToStr(size_t bit)
std::ostringstream stream;
stream.imbue(std::locale::classic());
stream << "UNKNOWN[";
if (bit < 8) {
stream << service_flag;
} else {
stream << "2^" << bit;
}
stream << "2^" << bit;
stream << "]";
return stream.str();
}