A CService with information about it as peer */
| 91 | |
| 92 | /** A CService with information about it as peer */ |
| 93 | class CAddress : public CService |
| 94 | { |
| 95 | public: |
| 96 | CAddress(); |
| 97 | explicit CAddress(CService ipIn, ServiceFlags nServicesIn); |
| 98 | |
| 99 | void Init(); |
| 100 | |
| 101 | ADD_SERIALIZE_METHODS; |
| 102 | |
| 103 | template <typename Stream, typename Operation> |
| 104 | inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) |
| 105 | { |
| 106 | if (ser_action.ForRead()) |
| 107 | Init(); |
| 108 | if (nType & SER_DISK) |
| 109 | READWRITE(nVersion); |
| 110 | if ((nType & SER_DISK) || |
| 111 | (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) |
| 112 | READWRITE(nTime); |
| 113 | uint64_t nServicesInt = nServices; |
| 114 | READWRITE(nServicesInt); |
| 115 | nServices = (ServiceFlags)nServicesInt; |
| 116 | READWRITE(*(CService*)this); |
| 117 | } |
| 118 | |
| 119 | // TODO: make private (improves encapsulation) |
| 120 | public: |
| 121 | ServiceFlags nServices; |
| 122 | |
| 123 | // disk and network only |
| 124 | unsigned int nTime; |
| 125 | |
| 126 | // memory only |
| 127 | int64_t nLastTry; |
| 128 | }; |
| 129 | |
| 130 | /** getdata message types */ |
| 131 | const uint32_t MSG_WITNESS_FLAG = 1 << 30; |
no outgoing calls
no test coverage detected