Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/protocol.h
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | public: | ||||
// disk and network only | // disk and network only | ||||
unsigned int nTime; | unsigned int nTime; | ||||
}; | }; | ||||
class CInv { | class CInv { | ||||
public: | public: | ||||
CInv(); | CInv(); | ||||
CInv(int typeIn, const uint256 &hashIn); | CInv(uint32_t typeIn, const uint256 &hashIn); | ||||
CInv(const std::string &strType, const uint256 &hashIn); | CInv(const std::string &strType, const uint256 &hashIn); | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
READWRITE(type); | READWRITE(type); | ||||
READWRITE(hash); | READWRITE(hash); | ||||
} | } | ||||
friend bool operator<(const CInv &a, const CInv &b); | friend bool operator<(const CInv &a, const CInv &b); | ||||
bool IsKnownType() const; | bool IsKnownType() const; | ||||
const char *GetCommand() const; | const char *GetCommand() const; | ||||
std::string ToString() const; | std::string ToString() const; | ||||
void print() const; | void print() const; | ||||
// TODO: make private (improves encapsulation) | // TODO: make private (improves encapsulation) | ||||
public: | public: | ||||
int type; | uint32_t type; | ||||
uint256 hash; | uint256 hash; | ||||
}; | }; | ||||
#endif // __INCLUDED_PROTOCOL_H__ | #endif // __INCLUDED_PROTOCOL_H__ |