// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#ifndef __cplusplus
-# error This header can only be compiled as C++.
-#endif
-
#ifndef __INCLUDED_PROTOCOL_H__
#define __INCLUDED_PROTOCOL_H__
return static_cast<uint16_t>(fTestNet ? 17777 : 7777);
}
-/** Message header.
- * (4) network identifier.
- * (12) command.
- * (4) size.
- * (4) checksum.
- */
+// Message header.
+// (4) network identifier.
+// (12) command.
+// (4) size.
+// (4) checksum.
class CMessageHeader
{
public:
const char* GetCommand() const;
std::string ToString() const;
+ int GetType() const { return type; }
+ uint256 GetHash() const { return hash; }
+
// TODO: make private (improves encapsulation)
- public:
- int type;
- uint256 hash;
+ private:
+ int type = 0;
+ uint256 hash = 0;
};
#endif // __INCLUDED_PROTOCOL_H__