This refactors the network message deserialization.
- It transforms the
CNetMessage
into a transport protocol agnostic message container. - A new class
TransportDeserializer
(unique pointer ofCNode
) is introduced, handling the network buffer reading and the decomposing to aCNetMessage
- No behavioral changes (in terms of disconnecting, punishing)
- Moves the checksum finalizing into the
SocketHandler
thread (finalizing was inProcessMessages
before)
The optional last commit makes the TransportDeserializer
following an adapter pattern (polymorphic interface) to make it easier to later add a V2 transport protocol deserializer.
Intentionally not touching the sending part.
Pre-Requirement for BIP324 (v2 message transport protocol). Replacement for #14046 and inspired by a comment from sipa