7 # error This header can only be compiled as C++.
10 #ifndef __INCLUDED_PROTOCOL_H__
11 #define __INCLUDED_PROTOCOL_H__
19 static inline unsigned short GetDefaultPort(
const bool testnet =
fTestNet)
21 return testnet ? 19336 : 9336;
37 CMessageHeader(
const char* pszCommand,
unsigned int nMessageSizeIn);
55 MESSAGE_SIZE_SIZE=
sizeof(
int),
56 CHECKSUM_SIZE=
sizeof(int),
58 MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE,
59 CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE,
60 HEADER_SIZE=MESSAGE_START_SIZE+COMMAND_SIZE+MESSAGE_SIZE_SIZE+CHECKSUM_SIZE
86 CAddress* pthis = const_cast<CAddress*>(
this);
92 if ((nType & SER_DISK) ||
93 (nVersion >= CADDR_TIME_VERSION && !(nType &
SER_GETHASH)))
118 CInv(
const std::string& strType,
const uint256& hashIn);
126 friend bool operator<(
const CInv& a,
const CInv& b);
128 bool IsKnownType()
const;
130 std::string ToString()
const;
148 #endif // __INCLUDED_PROTOCOL_H__
#define IMPLEMENT_SERIALIZE(statements)
unsigned long long uint64
unsigned char pchMessageStart[4]
A combination of a network address (CNetAddr) and a (TCP) port.
A CService with information about it as peer.