Changeset View
Changeset View
Standalone View
Standalone View
src/protocol.h
Show First 20 Lines • Show All 452 Lines • ▼ Show 20 Lines | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
READWRITE(nTime); | READWRITE(nTime); | ||||
} | } | ||||
uint64_t nServicesInt = nServices; | uint64_t nServicesInt = nServices; | ||||
READWRITE(nServicesInt); | READWRITE(nServicesInt); | ||||
nServices = static_cast<ServiceFlags>(nServicesInt); | nServices = static_cast<ServiceFlags>(nServicesInt); | ||||
READWRITEAS(CService, *this); | READWRITEAS(CService, *this); | ||||
} | } | ||||
// TODO: make private (improves encapsulation) | |||||
public: | |||||
ServiceFlags nServices; | ServiceFlags nServices; | ||||
// disk and network only | // disk and network only | ||||
unsigned int nTime; | unsigned int nTime; | ||||
}; | }; | ||||
/** getdata message type flags */ | /** getdata message type flags */ | ||||
const uint32_t MSG_TYPE_MASK = 0xffffffff >> 3; | const uint32_t MSG_TYPE_MASK = 0xffffffff >> 3; | ||||
Show All 16 Lines | |||||
/** | /** | ||||
* Inv(ventory) message data. | * Inv(ventory) message data. | ||||
* Intended as non-ambiguous identifier of objects (eg. transactions, blocks) | * Intended as non-ambiguous identifier of objects (eg. transactions, blocks) | ||||
* held by peers. | * held by peers. | ||||
*/ | */ | ||||
class CInv { | class CInv { | ||||
public: | public: | ||||
// TODO: make private (improves encapsulation) | |||||
uint32_t type; | uint32_t type; | ||||
uint256 hash; | uint256 hash; | ||||
public: | |||||
CInv() : type(0), hash() {} | CInv() : type(0), hash() {} | ||||
CInv(uint32_t typeIn, const uint256 &hashIn) : type(typeIn), hash(hashIn) {} | CInv(uint32_t typeIn, const uint256 &hashIn) : type(typeIn), hash(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); | ||||
Show All 25 Lines |