Description
Right now the message DataFromPeer
is received by two actors: PeerSynchronizer
and NodeViewSynchronizer
. And it is sent by NetworkController
, which has a sophisticated and generic message handling mechanism to decide if it should send a DataFromPeer
message to PeerSynchronizer
or to NodeViewSynchronizer
.
The question is: do we need all this generality? I think it is compromising clarity and making the code that handles these messages in PeerSynchronizer
and NodeViewSynchronixer
more complex than it needs to be. Maybe there is a simpler to accomplish the same thing, although I don't have a clear idea how at the moment.
Maybe a first step could be to specialize DataFromPeer
into more specific message classes, such as ModifiersFromPeer
, InvDataFromPeer
, SyncInfoFromPeer
, PeersFromPeer
, and so on...