diff options
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -596,9 +596,9 @@ public: mapMsgCmdSize mapRecvBytesPerMsgCmd; NetPermissionFlags m_permissionFlags; bool m_legacyWhitelisted; - double dPingTime; - double dPingWait; - double dMinPing; + int64_t m_ping_usec; + int64_t m_ping_wait_usec; + int64_t m_min_ping_usec; CAmount minFeeFilter; // Our address, as reported by the peer std::string addrLocal; @@ -703,12 +703,27 @@ public: CNetMessage GetMessage(const CMessageHeader::MessageStartChars& message_start, int64_t time) override; }; +/** The TransportSerializer prepares messages for the network transport + */ +class TransportSerializer { +public: + // prepare message for transport (header construction, error-correction computation, payload encryption, etc.) + virtual void prepareForTransport(CSerializedNetMsg& msg, std::vector<unsigned char>& header) = 0; + virtual ~TransportSerializer() {} +}; + +class V1TransportSerializer : public TransportSerializer { +public: + void prepareForTransport(CSerializedNetMsg& msg, std::vector<unsigned char>& header) override; +}; + /** Information about a peer */ class CNode { friend class CConnman; public: std::unique_ptr<TransportDeserializer> m_deserializer; + std::unique_ptr<TransportSerializer> m_serializer; // socket std::atomic<ServiceFlags> nServices{NODE_NONE}; |