diff --git a/src/seeder/bitcoin.h b/src/seeder/bitcoin.h --- a/src/seeder/bitcoin.h +++ b/src/seeder/bitcoin.h @@ -9,7 +9,9 @@ #include #include +#include #include +#include #include static inline unsigned short GetDefaultPort() { @@ -19,11 +21,13 @@ // The network magic to use. extern CMessageHeader::MessageMagic netMagic; -enum PeerMessagingState : bool { +enum class PeerMessagingState : bool { AwaitingMessages = false, Finished = true, }; +std::ostream &operator<<(std::ostream &os, const PeerMessagingState &state); + class CSeederNode { private: SOCKET sock; diff --git a/src/seeder/bitcoin.cpp b/src/seeder/bitcoin.cpp --- a/src/seeder/bitcoin.cpp +++ b/src/seeder/bitcoin.cpp @@ -19,6 +19,11 @@ static const uint32_t allones(-1); +std::ostream &operator<<(std::ostream &os, const PeerMessagingState &state) { + os << static_cast::type>(state); + return os; +} + void CSeederNode::BeginMessage(const char *pszCommand) { if (nHeaderStart != allones) { AbortMessage();