Removes the need to add and delete ip address from table. There are two primary reasons for not having the current usage of ip addresses with the peer table
Constant need to interact with hash table with each connection (calculating hashes is comparatively expensive than just passing pointers)
the addition and deletion of an ip address is done in two different layers (transport and peer respectively). This is harder to maintain and can lead to bugs
Rather, we define a new struct Packet in the wire package that includes both the message and the ip address. The inbound channel queue now accepts a wire.Packet instead of a wire.Msg, from which we can extract the message and the ip address and pass it as an additional argument to the receive callback function
Removes the need to add and delete ip address from table. There are two primary reasons for not having the current usage of ip addresses with the peer table
transport
andpeer
respectively). This is harder to maintain and can lead to bugsRather, we define a new struct
Packet
in thewire
package that includes both the message and the ip address. The inbound channel queue now accepts awire.Packet
instead of awire.Msg
, from which we can extract the message and the ip address and pass it as an additional argument to the receive callback function